public class ColorConverter
extends java.lang.Object
Constructor and Description |
---|
ColorConverter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getHexColor(java.awt.Color color) |
static java.lang.String |
getHTMLColor(java.awt.Color color)
This class builds the HTML color string from the color expressed in int.
|
static java.lang.String |
getHTMLColor(int rgb)
This class builds the Hmtl color string from the color
expressed in int
|
static int |
getRGBColor(java.lang.String htmlColor)
This method builds the int color representation from
the html color string
|
static int |
hexToInt(java.lang.String hex)
This method converts a hexadecimal number to the corresponding int value
|
static java.lang.String |
intToHex(int n,
int shift)
This method converts an int to the corresponding hexadecimal value
|
public static java.lang.String getHexColor(java.awt.Color color)
public static java.lang.String getHTMLColor(int rgb)
rgb
- the int representing the colorpublic static java.lang.String getHTMLColor(java.awt.Color color)
public static int getRGBColor(java.lang.String htmlColor)
htmlColor
- the color expressed in the html string formatpublic static java.lang.String intToHex(int n, int shift)
n
- the integer valueshift
- the number of bits to be shiftpublic static int hexToInt(java.lang.String hex)
hex
- the String containing the hexadecimal number