Package se.datadosen.util
Class Colors
java.lang.Object
se.datadosen.util.Colors
public class Colors
extends java.lang.Object
Utility Color class
-
Method Summary
Modifier and Type Method Description static java.awt.Color
getHTMLColor(java.lang.String htmlColor)
Parse color strings in the #rrggbb hex format and standard html color string format Also handle comma-separated list of r,g,b,(a) integer valuesstatic java.lang.String
toARGBHexColor(java.awt.Color c)
Return color in Java's ARGB format If color is fully opaque, use classic rgb formatstatic java.lang.String
toHTMLColor(java.awt.Color c)
Convert a Color to its HTML hex representation in the #rrggbb formatstatic java.lang.String
toRGBAHexColor(java.awt.Color c)
Return color in the new HTML rgba format If color is fully opaque, use classic rgb format
-
Method Details
-
getHTMLColor
public static java.awt.Color getHTMLColor(java.lang.String htmlColor) throws java.lang.IllegalArgumentExceptionParse color strings in the #rrggbb hex format and standard html color string format Also handle comma-separated list of r,g,b,(a) integer values- Parameters:
htmlColor
-- Returns:
- Throws:
java.lang.IllegalArgumentException
-
toHTMLColor
public static java.lang.String toHTMLColor(java.awt.Color c)Convert a Color to its HTML hex representation in the #rrggbb format- Since:
- 8.6.1
-
toRGBAHexColor
public static java.lang.String toRGBAHexColor(java.awt.Color c)Return color in the new HTML rgba format If color is fully opaque, use classic rgb format- Parameters:
c
-- Returns:
- Since:
- 15.1.3
-
toARGBHexColor
public static java.lang.String toARGBHexColor(java.awt.Color c)Return color in Java's ARGB format If color is fully opaque, use classic rgb format- Parameters:
c
-- Returns:
- Since:
- 23.3
-