public class ColorConverter extends Object
| Constructor and Description |
|---|
ColorConverter() |
| Modifier and Type | Method and Description |
|---|---|
String |
colorNameToHex(String colorName) |
String |
convertToHex(String color)
Converts the specified color code to hex code (as in
#F0F0EE). |
String |
decimalToHex(String color) |
String |
rgbToHex(String rgbColor)
Converts a RGB expression to hex code.
|
public String convertToHex(String color)
#F0F0EE). The following input formats are supported:
rgb(255,125,75)SpringGreencolor - a color code, in one of the supported formatsnull if there's no matching hex codepublic String rgbToHex(String rgbColor)
rgbColor - a RGB expressionpublic String colorNameToHex(String colorName)
colorName - a CSS color nameCopyright © 2004–2016 XWiki. All rights reserved.