Jump to content
ahmedb

finding color

Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...