0

I have a gwt log which is

GWT.log("color ="+colorWidget.getSelectionStyle().getBackgroundColor());

what i have is

String format with  [INFO] color = rgba(102, 0, 255, 0.506)

Does anybody can help me to convert this to Hex format?

noinstance
  • 761
  • 1
  • 7
  • 23
HellGuoan
  • 23
  • 1
  • 6

2 Answers2

0

You can use any JS solution or simply write your own method based on one the solutions you can find online. For example:

Convert RGBA to HEX

Community
  • 1
  • 1
Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • Hi, i do not think i can use JS in my GWT project. Also, what i have is a String ,not a Color. How should i convert this string to hex ?Thanks in advance – HellGuoan May 26 '15 at 15:45
0

The correct answer is to use a Java function to convert the RBG value to HEX. Unfortunately there is not GWT method that does this. A Helper method can be found here.

Community
  • 1
  • 1
dARKpRINCE
  • 1,538
  • 2
  • 13
  • 22