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
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
You could try.
Var col = 0xff;
Var redmask = 0xff;
Var greenmask = 0x00ff00;
Var bluemask = 0xff
R = col redmask;
G = col greenmask;
B = col bluemask;
R = R 16;
G = G 8;
//Blue does not need shifting.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
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
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 %
var col = 0xFF;
r = col 16;
g = (col 8) 0xff;
b = col 0xff;
var col2 = r 16 | g 8 | b;
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Alias(tm)
Sent: Wednesday, March 21, 2007 1:22 PM
To: Flashcoders mailing list
Subject: [Flashcoders]
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
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) ?
8 matches
Mail list logo