Posted By

adrianparr on 02/24/10


Tagged

css hex integer colour color convert int as3 0x


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tspitzr


AS3 Convert a Hex Color (integer) to a CSS Color (string)


 / Published in: ActionScript 3
 

  1. function hex2css(color:int):String
  2. {
  3. return "#" + color.toString(16).toUpperCase();
  4. }
  5.  
  6. var myColour:int = 0xFF6699;
  7. trace(hex2css(myColour));
  8. // OUTPUT: #FF6699

Report this snippet  

You need to login to post a comment.