I can't seem to find a function/procedure to check the presence of a certain color at a co-ordinate. If it color at 483, 261 = 8026754 then result := true.
Is there a function/procedure to do this?
If not has anybody made one?
I really need one.
Printable View
I can't seem to find a function/procedure to check the presence of a certain color at a co-ordinate. If it color at 483, 261 = 8026754 then result := true.
Is there a function/procedure to do this?
If not has anybody made one?
I really need one.
Yep, GetColor.
Oww, great. Ty. ^_^
Can't seem to find it. What scar file is it located in?
eidt2: my bad, seems to be simply GetColor(x, y). Easy.
Description can be found in scar (not srl) help file:
so:Quote:
function GetColor(x, y: Integer): Integer;
Return color number at x, y.
shud do the trick.SCAR Code:If (GetColor(483,261)=8026754) then result:=true;
haha, Yeah I worked it out before that post, but thank you very much.
It's so simple I feel like a nubby.
Ya, you stupid nub :p. Kidding.
lol, no you're not.
/me cuts myself.
Ya, to tell the truth, I really hate you and hope that you die, OK? :):p
Roflcakes :D
I Love You.
Ok? I "Love" you too? :p
Ok, now I've figured that im checking the colour at a certain pixel against another colour, but I want to check the colour against another colour with a certain tolerance (ie, of about 4).
How would I do this?
Help greatly appreciated.
I don'y get why you couldn't just use
SCAR Code:if FindColorTolerance(483,261,8026754,msx1,msy1,msx2,msy2)then
begin
//the rest of your procedure
end;
I thought using getcolor would be easiest seeing as I thought the colour was static, but now I find out its not, therefore using findcolortol is probably the best idea. Thank you very much.
Wow, similar colours seems to work great =D ty.
Your welcome. :D
FindColorTolerance will do the same thing except with less lines wont it?
FindColor finds the colour in a box whereas GetColor checks if the colour at that exact coordinate is equal to what you specify.
We should make a GetColorTolerance :p
lol, yeah that was the procedure I was looking for =P
Similar colors does the same thing though.
What I meant was a GetColor but with a tolerance so that if the GetColor returned a colour that was not exactly the colour you wanted but within a certain tolerance it would still return true. But then again I think this works:
SCAR Code:if (SimilarColors(GetColor(x, y), second colour, 10)) then
Writeln('yay');
lol, that does work and thats what im using, I was saying getcolortol would be a very good idea.
That is why FindColorTol would work better; because it only takes one line, yet does the same thing, and it has tolerance.
What? No it wouldnt, not if you are looking for it in a certain place, exact coords stuff.