src/js/utils.js
branchpopcorn-port
changeset 358 430c1a7a09de
parent 354 002c314cabbf
child 362 0b1bf06c28ed
--- a/src/js/utils.js	Wed Nov 30 11:22:01 2011 +0100
+++ b/src/js/utils.js	Wed Nov 30 12:17:19 2011 +0100
@@ -83,6 +83,20 @@
     return count;
 };
 
+// conversion de couleur Decimal vers HexaDecimal || 000 si fff
+IriSP.DEC_HEXA_COLOR = function (dec) {
+	 var hexa='0123456789ABCDEF',hex='';
+	 var tmp;
+	 while (dec>15){
+		  tmp = dec-(Math.floor(dec/16))*16;
+		  hex = hexa.charAt(tmp)+hex;
+		  dec = Math.floor(dec/16);
+	 }
+	 hex = hexa.charAt(dec)+hex;
+	 if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
+	 return(hex);
+};
+
 /* for ie compatibility
 if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
    Object.defineProperty=function(obj,prop,desc) {