/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var r:uint = 153; var g:uint = 0; var b:uint = 204; var colour:uint = r << 16 | g << 8 | b; trace("colour: "+colour); // OUTPUT // colour: 10027212
URL: http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/