Return to Snippet

Revision: 24525
at March 3, 2010 04:42 by adrianparr


Initial Code
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

Initial URL
http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/

Initial Description

                                

Initial Title
AS3 Convert RGB Values to a Colour Using Bitwise Shift

Initial Tags
color

Initial Language
ActionScript 3