Sign in to follow this  
Followers 0
joeyone

finding range of RGB

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0