USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 9/27/09 09:15 AM
Sign-Up: 09/09/07
Posts: 3,482
How can I convert a color in the "0xRRGGBB" format to the red, blue, and green values for that color?
I code in AS2, in case I forgot to mention it.
Posted at: 9/27/09 09:28 AM
Sign-Up: 02/28/06
Posts: 568
http://www.newgrounds.com/bbs/topic/1078 634
Like Guitar Hero or Rock Band? -- CLICK HERE
Posted at: 9/27/09 10:05 AM
Sign-Up: 08/10/05
Posts: 6,027
var colour : Number = 0xFF0000; var r = colour >> 16 & 0xFF; var g = colour >> 8 & 0xFF; var b = colour & 0xFF;
>> is the bitwise right shift operator and & is the bitwise and operator.
Portfolio(Under construction): UnknownFury.com | Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com Follow me on twitter!
Posted at: 9/27/09 10:13 AM
I wish I had known it was that easy.
Posted at: 9/27/09 10:47 AM
At 9/27/09 10:05 AM, UnknownFury wrote: var colour : Number = 0xFF0000; var r = colour >> 16 & 0xFF; var g = colour >> 8 & 0xFF; var b = colour & 0xFF; >> is the bitwise right shift operator and & is the bitwise and operator.
Thanks!
Posted at: 9/27/09 11:18 AM
Sign-Up: 10/05/08
Posts: 1,607
At 9/27/09 10:13 AM, matrix5565 wrote: I wish I had known it was that easy.
haha :/ poor you going through all that effort and getting owned by 3 lines of code :P
AS2||AS3||Motox Thanks to hdxmike for the sig :]
All times are Eastern Standard Time (GMT -5) | Current Time: 06:15 AM
<< Back