/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var brightPinkHex:uint = 0xFF32CC; var brightPinkRGB:Object = HexToRGB(brightPinkHex); trace(brightPinkRGB.r+ ", " + brightPinkRGB.g + ", " + brightPinkRGB.b); function HexToRGB(value:uint):Object { var rgb:Object = new Object(); rgb.r = (value >> 16) & 0xFF rgb.g = (value >> 8) & 0xFF rgb.b = value & 0xFF return rgb; } // OUTPUT // 255, 50, 204