Colors are objects, like Strings, so you should compare them using:
myColor.equals(Color.BLACK)
instead of
myColor == Color.BLACK
The second compares whether the two variables point to the exact same object in memory, whereas the first compares whether they are two different color objects that both the same shade of color (black).
In general, use == for primitive types (like int), and .equals(...) to compare object types.