frontmill Posted June 22, 2007 Posted June 22, 2007 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
PsaltyDS Posted June 22, 2007 Posted June 22, 2007 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 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. 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
PsaltyDS Posted June 22, 2007 Posted June 22, 2007 (edited) 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. P.S. No fair, deleting posts while I'm replying to them! Edited June 22, 2007 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
DW1 Posted June 22, 2007 Posted June 22, 2007 lol, I was wondering where that quote came from LOL LOL LOL AutoIt3 Online Help
frontmill Posted June 22, 2007 Author Posted June 22, 2007 (edited) 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 Edited June 22, 2007 by frontmill
Zacharot Posted June 22, 2007 Posted June 22, 2007 (edited) 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? 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 June 22, 2007 by Zacharot
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now