Jump to content

Color is Red or Black?


Recommended Posts

sorry i didnt really understand your answer ...

i know the coordinates of the pixel and i just want to know if its red or black ... light red dark red or light black, dark black

i just want to know if its more red or more black

thanks

Link to comment
Share on other sites

Try this, change the pixel coordinates to match the pixel you wish to check.

HotKeySet( "{Esc}", "test_pixel" )

$RED = Dec( "FF0000" )
$BLACK = 0

While 1
        Sleep( 500 )
WEnd

Func test_pixel()
    $color = PixelGetColor( 300, 160 )
    $color = Dec( $color )
    
    $red_diff = Abs( $RED - $color )
    $black_diff = $color - $BLACK

    If $red_diff > $black_diff Then
        MsgBox( 0, "Color Match", "The pixel color is more black than red." )
    ElseIf $black_diff > $red_diff Then
        MsgBox( 0, "Color Match", "The pixel color is more red than black." )
    Else
        MsgBox( 0, "Color Match", "The pixel color is just as close to black as it is to red." )
    EndIf
EndFunc

Hope that helps,

Don

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

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