Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-22 Thread Amir T Rocker
Hi buddy, isnt the format ARGB ? HEX = 0x AA RR GG BB ? Just a suggestion :) But I think what you think are your blues ar ein reality your Greens :) Also dependant on the version of flash you are working with... Best of Luck and successfull clicking Amir Am 07:21 PM 3/21/2007 schrieben

Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-22 Thread elibol
Give this a shot function getRGB(c:Number):Array { return [c16, c8~0xFF00, c~0xF00]; } On 3/21/07, Alias™ [EMAIL PROTECTED] wrote: Hi guys, This is annoying me - I'm just trying to get the seperate RGB component values out of a hex number, then manipulate and reconstruct them. var

[Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Alias™
Hi guys, This is annoying me - I'm just trying to get the seperate RGB component values out of a hex number, then manipulate and reconstruct them. var col = 0xFF; r = col 16; g = col 8 % 255; b = col % 255; trace(r=+r.toString(16)); trace(g=+g.toString(16)); trace(b=+b.toString(16));

RE: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Steve Abaffy
] On Behalf Of AliasT Sent: Wednesday, March 21, 2007 1:22 PM To: Flashcoders mailing list Subject: [Flashcoders] Annoying, (should be simple) bitwise problem Hi guys, This is annoying me - I'm just trying to get the seperate RGB component values out of a hex number, then manipulate and reconstruct

Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Mark Winterhalder
Hi Alias, it's either % 256 or 255. But % 255 gives you the wrong result -- (255 % 255 == 0). Either: var r = col 16; var g = (col 8) % 256; var b = col % 256; Or: var r = col 16; var g = (col 8) 0xff; var b = col 0xff; I prefer the second. HTH, Mark On 3/21/07, Alias™ [EMAIL

Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Glen Pike
Use instead of % r = (col 16) 0xFF; g = (col 8) 0xFF; b = col 0xFF; Glen :) Alias™ wrote: Hi guys, This is annoying me - I'm just trying to get the seperate RGB component values out of a hex number, then manipulate and reconstruct them. var col = 0xFF; r = col 16; g = col 8 %

RE: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Jonathan.Doklovic
] Annoying, (should be simple) bitwise problem Hi guys, This is annoying me - I'm just trying to get the seperate RGB component values out of a hex number, then manipulate and reconstruct them. var col = 0xFF; r = col 16; g = col 8 % 255; b = col % 255; trace(r=+r.toString(16)); trace(g

Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Geoff Stearns
there's an old article on the adobe dev center that talks all about this... go check it out: http://www.adobe.com/devnet/flash/articles/bitwise_operators.html On Mar 21, 2007, at 2:21 PM, Alias™ wrote: Hi guys, This is annoying me - I'm just trying to get the seperate RGB component

Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-21 Thread Latcho
there might be more clever ways... var col = 0x0199FF; var _r = (col 16); var _g = (col 8 ^ _r 8); var _b = (col^ (_r 16 | _g 8)); trace(r=+_r); trace(g=+_g); trace(b=+_b); var r = (_r.toString(16).length 2) ? 0+_r.toString(16) : _r.toString(16); var g = (_g.toString(16).length 2) ?