public class ColorUtils extends Object
Constructor and Description |
---|
ColorUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateColorDistSq(Color color0,
Color color1)
Calculates the distance between two Colors.
|
static String |
getClosestNamedColor(String hexString)
Get the color name of the color that is closest to the given hex color
value (as a 6-digit hex String).
|
static Optional<String> |
getNamedColor(int r,
int g,
int b)
Get the named color that has exactly the given RGB color value or
null if no such named color exists.
|
static Optional<String> |
getNamedColor(String hexString)
Get the color name of the color that is exactly equal to the given hex color
value (as a 6-digit hex String).
|
public static String getClosestNamedColor(String hexString)
hexString
- the String containing 6 hex-digits representing a
color value ("000000" to "FFFFFF")public static Optional<String> getNamedColor(int r, int g, int b)
r
- the red component of the color (0 - 255)g
- the green component of the color (0 - 255)b
- the blue component of the color (0 - 255)public static Optional<String> getNamedColor(String hexString)
hexString
- the String containing 6 hex-digits representing a
color value ("000000" to "FFFFFF")