KernelPanic
KernelPanic

Reputation: 2432

Passing RGB Color to .setBackgroundColor

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

Answers (2)

Reimeus
Reimeus

Reputation: 159844

This is normally done using decode:

Color color = Color.decode("0x121E31");

Upvotes: 9

Rachana K
Rachana K

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

Related Questions