if ("FFFFFF".equals(hex(ycolor, 6))) return "white";
String colorSensing(int x, int y, int yOffset) {
final color c = get(x, y + yOffset);
final String webColor = hex(c, 6);
switch (webColor) {
case "FFFFFF":
return "white";
default:
return "unknown";
}
}
Answers
hex() returns a String
you are comparing that with
#FFFFFF
which is actually an int(?) (tryprintln(#FFFFFF)
and see what it does).you could try
hex(color).equals("#FFFFFF")
... it might work...actually,
ycolor == #FFFFFF
might also work(not in a position to test, sorry)
if ("FFFFFF".equals(hex(ycolor, 6))) return "white";
Thanks guys!