Jump to content

Seperating R,G, and B


 Share

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)

Please help

Thanks,

---Paulie

Edit: forgot my code :P

Edited by Paulie
Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...