Jump to content

pixel colors


Recommended Posts

when i use the pixelGetColor function i get a big integer. what i was wandering is how can i turn this into the rgb model (though it apparently already is, just in a different format), so that i could separately see the Red, Green, and Blue composing this color. (where black would be (0,0,0) and white (255,255,255)).

anyone know how these three numbers are used to form the big integer you get with that function? and how to get these three numbers out of that integer?

thank you for your help :P

Link to comment
Share on other sites

$Color = Dec(0xFFFFFF) ; value = 16782893778 something

$Hex = Hex($Color, 6) ; value = 0xFFFFFF

$StrHex = StringTrimLeft(String($Hex),2) ; value = FFFFFF

im sory, guess i am a little slow, but how do i get the classic rgb format (red, green, blue) from this?

Link to comment
Share on other sites

im sory, guess i am a little slow, but how do i get the classic rgb format (red, green, blue) from this?

#include <Misc.au3>

$Color = Dec(0xFFFFFF) ; value = 16782893778 something
$Hex = Hex($Color, 6) ; value = 0xFFFFFF
$StrHex = StringTrimLeft(String($Hex),2) ; value = FFFFFF

$StrRed = StringMid($StrHex,0,2) ; value = FF

$Red = _ColorGetRed($Red) ; value = 255
$HexRed = Hex($Red,2) ; value = 0xFF
$StrRed2 = StringTrimLeft($HexRed, 2) ; value = FF  ( different method )

Same for other colors. Before you ask how to do it for green and blue check the help file what this really does and means. :P

Link to comment
Share on other sites

#include <Misc.au3>

$Color = Dec(0xFFFFFF) ; value = 16782893778 something
$Hex = Hex($Color, 6) ; value = 0xFFFFFF
$StrHex = StringTrimLeft(String($Hex),2) ; value = FFFFFF

$StrRed = StringMid($StrHex,0,2) ; value = FF

$Red = _ColorGetRed($Red) ; value = 255
$HexRed = Hex($Red,2) ; value = 0xFF
$StrRed2 = StringTrimLeft($HexRed, 2) ; value = FF  ( different method )

Same for other colors. Before you ask how to do it for green and blue check the help file what this really does and means. :unsure:

_ColorGetRed

thanks for your help, this is what i needed :P

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...