# Seperating R,G, and B

## Recommended Posts

Okay, I have this code, what I'm trying to do is figure out how to have either a decimal/hex number, and figure out the red green and blue values separately.

```While 1
For \$x1 = 0 to 10;@DesktopWidth
For \$y1 = 0 to 10;@DesktopHeight
\$colorD = PixelGetColor(\$x1, \$y1)
\$colorH = Hex(\$ColorD)
MsgBox(0, \$x1&", "&\$y1, \$ColorH)
Next
Next
WEnd```

like i know in typical its "0xRRGGBB", but what about hex values like this "0x007094DD"

how do i determine whats what

(and yes, that does work as a color code even though it's more then six places)

Thanks,

---Paulie

Edit: forgot my code

Edited by Paulie

##### Share on other sites

Check out these UDFs..

##### Share on other sites

Check out these UDFs..

lol thanks missed those :"> :">

##### Share on other sites

one more question,

should the first 2 results in this msgbox be the same? why arent they?

```For \$y1 = 0 to 50
For \$x1 = 0 to 50
\$colorD = PixelGetColor(\$x1, \$y1)
\$colorH = Hex(\$ColorD)
\$Red = _ColorGetRed(\$colorH)
\$Green = _ColorGetGreen(\$colorH)
\$Blue = _ColorGetBlue(\$colorH)
\$color2 = \$Red&\$Green&\$Blue
\$color2H = Hex(\$color2)
MsgBox(0, \$x1&", "&\$y1, \$ColorH&" : "&\$color2H&" : "&\$color2)
Next
Next```

Nmv i found what was wrong, missing a "0x"

Edited by Paulie

## Create an account

Register a new account