2 Replies Latest reply on Apr 1, 2010 1:07 PM by Cr99

    Hex to Color number and back (charting)

    Cr99 Level 1

      I am creating some charts and assigning colors to the series in actionscript like this:

       

      var col:uint = new uint(new Number("0x0000CC"));     

      // col value is now 204

      var stroke:Stroke = new Stroke();

      stroke.color = col;

      lineSeries.setStyle("lineStroke", stroke);

       

      But when I try to convert the color back to the 0x format later, I get:

       

      var num:Number = lineSeries.getStyle("color");

      // num value is now 734012

       

      trace(item.label, "0x"+num.toString(16).toUpperCase()); // output is 0xB333C

       

       

       

      So how doe I get it back to the original 0x0000CC ?