Jump to content

finding range of RGB


joeyone
 Share

Recommended Posts

I want to use getpixelcolor() to find a range of colors in the same tone

is RGB the easyiest format to do this?

for example find colors between these ranges with pixelgetcolor

R 230 - 240

G 120 - 130

B 165 - 160

is there a easy way to do this?

thanks in advance

Edited by joeyone
Link to comment
Share on other sites

Maybe...

Dim $arr[3] = [10, 10, 5]
Dim $aR[3] = [230, 00, 00]
Dim $aB[3] = [00, 120, 00]
Dim $aG[3] = [00, 00, 160]

For $i = 0 to 2
    $var = $arr[$i]
    $r = $aR[$i]
    $b = $aB[$i]
    $g = $aG[$i]
    $hex = "0x" & Hex ($r & $b & $g, 6)
    PixelSearch (0, 0, 100, 100, $hex, $var)
    ConsoleWrite ("- Hex Value " & ($i + 1) & " = " & $hex & " ERROR = " & @error & @CRLF )
Next
Link to comment
Share on other sites

Link to comment
Share on other sites

Sorry. Didn't Read

A simple If statement:

$ret = 15;PixelGetColor (x, y)

Select

Case ($ret > 10 AND $ret < 20)

MsgBox (0, "", "")

EndSelect

imagine we have a color that is blue and somtimes

this color changes to slightly darker blue or lighter blue

even if it changes we need to identify the color as "blue"

if we then need to identify more colors who can possibly be at the same

pixel for example red, green and purple do i need to change alot in

the script you attached to make this possible?

Edited by joeyone
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...