Jump to content

Shade Variation


Recommended Posts

I was wondering how the shade variation thing in pixelsearch is done. Assume i have decimal colour value as returned by the pixelgetcolor function. And I have another colour code for example yellow. Is there any way to check if the color returned by pixelgetcolor is within a certain shade range of the " yellow color" i was just talking about. (not pixelsearch function!)

Thanks in advance :rolleyes:

Link to comment
Share on other sites

I was wondering how the shade variation thing in pixelsearch is done. Assume i have decimal colour value as returned by the pixelgetcolor function. And I have another colour code for example yellow. Is there any way to check if the color returned by pixelgetcolor is within a certain shade range of the " yellow color" i was just talking about. (not pixelsearch function!)

Thanks in advance :rambo:

1. Convert decimal to hex (24bits or 6 hex digits)

2. Each group of two hex digits (8bits) is one color: R, G, and B.

3. If the R, G, and B colors are within +/- the variation, you have a match.

:rolleyes:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Isn't it so that the hexidecimal codes are the ones where white if #FFFFFF? Wouldn't that mean that i wont be able to add something up with it, since it isnt a number?

I don't know what "#FFFFFF" is, but 0xFFFFFF (1677721510) is white. Do you have a color number already (you mentioned a yellow)? If so post it, and I'll use it in an example.

:rolleyes:

P.S. No fair, deleting posts while I'm replying to them!

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

The colour actually was white (16777215). Can you explain me how to calculate that value to Hexidecimal?

I decided to try fixing it myself first, but help is actually eqasier :rolleyes:

Edited by frontmill
Link to comment
Share on other sites

Hex means hexadecimal, or base 16, whereas decimal is base 10

when you count in decimal, it's 00,01,02,03,04,05,06,07,08,09.. repeat as 10,11,12, etc, but in hex it's..

00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F, repeat as.. 10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F

get it? :rolleyes:

10 in hex, is 16 in decimal

20 in hex, is 32 in decimal

FF in hex is 255 in decimal

computers use the 0 as a number (fancy that) so it's actually counted in the first set as creating 16, such as 1-9 make base 10, because you need the 0

so 00 (or 0) through 255 is 256, so FF*FF*FF = FFFFFF, or 0xFFFFFF, or #FFFFFF (html)

so in fact, FF*FF*FF (10*10*10 = 1000, same thing) equals 16777216

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