Reputation: 2432
I have some color, coded in RGB
format: 121E31 hex
. How do I pass this color to Java's Color
class?
Upvotes: 3
Views: 4702
Reputation: 159844
This is normally done using decode:
Color color = Color.decode("0x121E31");
Upvotes: 9
Reputation: 104
The RGB value of your "121E31" color is : 18,30,49
For this refer http://www.yellowpipe.com/yis/tools/hex-to-rgb/color-converter.php
Now this RGB value can be added using java class as follows
Color c = new Color(18,30,49);
Upvotes: 2