/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var magentaRed:int = 255; var magentaGreen:int = 0; var magentaBlue:int = 255; var magentaHex:uint = RGBToHex(magentaRed, magentaGreen, magentaBlue); trace("magentaHex: ", magentaHex); function RGBToHex(r:int, g:int, b:int):uint { var hex:uint = r << 16 | g << 8 | b; return hex; } // OUTPUT // 16711935