color match

Asked by vidya rajagopal

Hi ,

I have a check box , which turns green when enabled and gray when disabled . Now how do i identfy this change using sikuli as the images would be the same but only the color of the image changes.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

Make a screenshot of the green version: cbGreen

the region, where the checkbox should be: cbRegion

if cbRegion.exists(Pattern(cbGreen).similar(0.99)):
    print "should be green"
else:
    print "should be gray"

Revision history for this message
vidya rajagopal (vidya-rajagopal) said :
#2

Thanks for the help. It works !

Revision history for this message
vidya rajagopal (vidya-rajagopal) said :
#3

Thanks RaiMan, that solved my question.