Jump to content

Recommended Posts

Posted (edited)

Hi !

Here's what i'm trying to do, if anyone got ideas or knows which functions would help me, feel free to post ! Thanks :)

I would like to calculate the average color value in an area and have the function returning wether it belongs to a color range or not. Something like that :

Boolean PixelColorCheckSum (x1, y1, x2, y2, $colorA, $colorB, $colorTest)

returns True if $colorTest is within the range $colorA - $colorB

goal : given a square area of the screen.. telling if the average color is more "yellow" .."orange", "red", "blue", "green", "purple", "pink", ..

Edited by MikeP
Posted

Hi !

Here's what i'm trying to do, if anyone got ideas or knows which functions would help me, feel free to post ! Thanks :)

I would like to calculate the average color value in an area and have the function returning wether it belongs to a color range or not. Something like that :

Boolean PixelColorCheckSum (x1, y1, x2, y2, $colorA, $colorB, $colorTest)

returns True if $colorTest is within the range $colorA - $colorB

As the colours are all hex, couldn't you add them all together and divide by the total? :(
Posted

That would be easy but it's not working (in RGB) :

pure blue = 0000FF

pure yellow = FFFF00

hex addition = FFFFFF

hex division by 2 = 7FFFFF.8 which is a color near Cyan

and everyone knows blue+yellow = green

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
×
×
  • Create New...