Page 1 of 1
How to test 2 objets are the same color,No Mousecolour Func
Posted: Fri Jul 03, 2015 11:51 am
by Fasasoftware
Hi to everybody,
I need to test 2 objects if they are the same colour in a specified location, without using a Mousecolour Function...because block my app functionality.
In other words, i have an rectagle object with different colour inside and with another little rectangle for example black , each up on each its, if the 2 object are the same colour in the same location of my window app then beep.
I have seen the function Itersect don't do this.
Is there's a manner to do this???
I thank you so much!
Lestroso
www.fasasoftware.com
Re: How to test 2 objets are the same color,No Mousecolour F
Posted: Fri Jul 03, 2015 10:17 pm
by dunbarx
Hi.
Perhaps I am misunderstanding, but what happens if you compare the backColors of each of those two objects? In other words, if your problem was to determine if the two were aligned vertically, you might compare their "lefts". So is there a color property that fits the bill?
Craig Newman
Re: How to test 2 objets are the same color,No Mousecolour F
Posted: Fri Jul 03, 2015 11:04 pm
by Fasasoftware
Hy dunbarks,
well i would like a function , or a script, to retrieve like the same "MOUSECOLOR" instruction but not that, because every second, i want to test in a certain image, in a specified location, what colors there is...
i have tryed to do this...it works but it the wrong way and not right for my problem.
Code: Select all
global test1
global test2
on mouseUp
get the effective backgroundColor of graphic "white"
put it into test1
get the effective backgroundColor of graphic "red"
put it into test2
if test1 = test2 then answer "They are The Same Colors!!"
if test1 <> test2 then answer "Sorry They are NOT The Same Colors!!"
end mouseUp
You should create yourself 2 graphics in the same colors and different colors to test this script..
But i need to test the color in a certain point inside of a image,without mouse color...
I seen the intersect function, but do not test the color of 2 objects...
Can you help me please???
Thanks a lot,
Lestroso

Re: How to test 2 objets are the same color,No Mousecolour F
Posted: Sat Jul 04, 2015 2:00 pm
by Fasasoftware
Hi To EveryBody,
searching on the forum, i found a very useful script by "Bernd", this boy i think live on the moon, his script is perfect for me!!!Solved in full My Problem!!!
I attached the link below, where there's also the script to download made by Bernd...
Thanks a lot to everybody!!!
Lestroso
http://forums.livecode.com/viewtopic.php?f=7&t=7398
Re: How to test 2 objets are the same color,No Mousecolour F
Posted: Mon Jul 06, 2015 10:57 pm
by dunbarx
Hi.
If you have a solution, you probably do not need to investigate further. But I still do not exactly know what you wanted. If you have a colored object, and this does not work for you:
Code: Select all
on mouseUp
answer mouseColor()
end mouseUp
Is it that you want to specify a location (or two), and find the colors at that point?
Code: Select all
on mouseUp
ask "Where to test?" --assume you have x,y properly formatted with two integers
set the screenMouseLoc to item 1 of the rect of this stack + item 1 of it & "," & item 2 of the rect of this stack + item 2 of it
answer mouseColor()
end mouseUp
You can do this with two objects and compare, of course. But is this what you were asking for?
Craig
Re: How to test 2 objets are the same color,No Mousecolour F
Posted: Tue Jul 07, 2015 1:45 pm
by Fasasoftware
Hi Craig,
Thanks for your answer , but i cannot use the mousecolor function, because block my software.
Now i'm using the script of bernt, that use a snapshot to retrieve a color in a certain position, very useful.
Thanks again a lot,
Lestroso
