I have a java code that returns decimal values as shown below
[1.0, 0.0, 0.0] for Red
[0.0, 1.0, 0.0] for Green
the first value denotes the color code for Red, the second value denotes color code for Green and the third value denotes Color code for Blue.
Is there any way we can convert these RGB values into the respective color in java?
There are an example to return the color name which depend on using Reflection to get the name of the color (java.awt.Color)
and in the main
You have to know that :
"java.awt.Color"
defined this colors: