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
#FFFFFFwhich is actually an int(?) (tryprintln(#FFFFFF)and see what it does).you could try
hex(color).equals("#FFFFFF")... it might work...actually,
ycolor == #FFFFFFmight also work(not in a position to test, sorry)
if ("FFFFFF".equals(hex(ycolor, 6))) return "white";Thanks guys!