ahmedb Posted October 18, 2011 Share Posted October 18, 2011 if (FindColor(x, y, 1381828, 670, 626, 670, 626)) then begin ok so the color is 1381828, so how do i make it so: if the color is greater than 1380000, and less than 1420000 then begin how do i do that? Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 18, 2011 Share Posted October 18, 2011 Color doesn't work that way unfortunately. It's a decimal hex system, meaning there could be drastic differences between color 4000 and 4001. Quote Link to comment Share on other sites More sharing options...
ahmedb Posted October 18, 2011 Author Share Posted October 18, 2011 send pmwhen i looked from lik 13463146 and like a few thousand a way it was like almost the same Quote Link to comment Share on other sites More sharing options...
KingKong Posted October 18, 2011 Share Posted October 18, 2011 if (FindColor(x, y, 1381828, 670, 626, 670, 626)) then begin ok so the color is 1381828, so how do i make it so: if the color is greater than 1380000, and less than 1420000 then begin how do i do that? From what I understood, you are getting the color from one pixel. In that case use getcolor(670, 626) instead of findcolor. After that its simple: [scar] if (GetColor(670, 626) > 1380000) and (GetColor(670, 626) < 1420000) then something; [/scar] Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 18, 2011 Share Posted October 18, 2011 if (FindColor(x, y, 1381828, 670, 626, 670, 626)) then begin ok so the color is 1381828, so how do i make it so: if the color is greater than 1380000, and less than 1420000 then begin how do i do that? From what I understood, you are getting the color from one pixel. In that case use getcolor(670, 626) instead of findcolor. After that its simple: [scar] if (GetColor(670, 626) > 1380000) and (GetColor(670, 626) < 1420000) then something; [/scar] Unfortunatly that's not the case. As IceFire pointed out, there's big differences between the color values, 2 colors that are just a digit appart can be completely different. 255 and 256 for example, 255 is red and 256 is probably close to black. The colors are built up out of RGB components this means that 3 bytes of the color value make up the RGB values. If you don't know much about memory storage this will be hard to explain, but basically, a change in the R range changes the color by just 1. A change in the G range will change the color by 256 anc a change in the B range will change the color by 65536. Quote Link to comment Share on other sites More sharing options...
ahmedb Posted October 18, 2011 Author Share Posted October 18, 2011 but will that work?^^ Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 18, 2011 Share Posted October 18, 2011 but will that work?^^ As I pointed out, no it wouldn't... Quote Link to comment Share on other sites More sharing options...