← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #288708]: JRuby : how to get a pixel color to ensure that a button is enabled or not

 

Question #288708 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/288708

    Status: Open => Answered

RaiMan proposed the following answer:
require 'java'
java_import java.awt.Color

(see: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby)

... this works in SikuliX script:
color = Location(x,y).getColor() # color is of type java.awt.Color

if color = Color.BLACK:
     print "selected"
else:
     print "not selected"

... about features of class Color:
https://docs.oracle.com/javase/8/docs/api/java/awt/Color.html

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.