Package com.kheops.util
Class ColorConverter
java.lang.Object
com.kheops.util.ColorConverter
This class permits to convert color expressed in hexadecimal to decimal (int) and vice vesa
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getHexColor
(Color color) static String
getHTMLColor
(int rgb) This class builds the Hmtl color string from the color expressed in intstatic String
getHTMLColor
(Color color) This class builds the HTML color string from the color expressed in int.static int
getRGBColor
(String htmlColor) This method builds the int color representation from the html color stringstatic int
This method converts a hexadecimal number to the corresponding int valuestatic String
intToHex
(int n, int shift) This method converts an int to the corresponding hexadecimal value
-
Constructor Details
-
ColorConverter
public ColorConverter()
-
-
Method Details
-
getHexColor
-
getHTMLColor
This class builds the Hmtl color string from the color expressed in int- Parameters:
rgb
- the int representing the color
-
getHTMLColor
This class builds the HTML color string from the color expressed in int.- Returns:
- HTML hex color
-
getRGBColor
This method builds the int color representation from the html color string- Parameters:
htmlColor
- the color expressed in the html string format
-
intToHex
This method converts an int to the corresponding hexadecimal value- Parameters:
n
- the integer valueshift
- the number of bits to be shift
-
hexToInt
This method converts a hexadecimal number to the corresponding int value- Parameters:
hex
- the String containing the hexadecimal number- Returns:
- the corresponding int value.
-