public class ColorUtil
extends java.lang.Object
Constructor and Description |
---|
ColorUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
toColor(java.lang.String color)
Ensures that the color is in #RRGGBB format (will add the # if missing)
|
static java.lang.String |
toComplimentColor(java.lang.String in)
Color should be in the format #RRGGBB and returns it in the same format
|
static java.lang.String |
toDarkerColor(java.lang.String in)
Color should be in the format #RRGGBB and returns it in the same format
|
static java.lang.String |
toDarkerColor(java.lang.String in,
int weight)
Color should be in the format #RRGGBB and returns it in the same format
|
static java.lang.String |
toLighterColor(java.lang.String in)
Color should be in the format #RRGGBB and returns it in the same format
|
static java.lang.String |
toReadableColor(java.lang.String in)
returns black or white depending on if the background is light or dark
|
static java.lang.String |
toRGBACSS(java.lang.String in,
float alpha)
Converts a color from #RRGGBB to "rgba(rr,gg,bb,aa)"
|
public static java.lang.String toComplimentColor(java.lang.String in)
in
- public static java.lang.String toDarkerColor(java.lang.String in, int weight)
in
- weight
- the higher the weight the darker the colorpublic static java.lang.String toDarkerColor(java.lang.String in)
in
- public static java.lang.String toLighterColor(java.lang.String in)
in
- public static java.lang.String toReadableColor(java.lang.String in)
in
- public static java.lang.String toColor(java.lang.String color)
color
- public static java.lang.String toRGBACSS(java.lang.String in, float alpha)
in
- Coloralpha
- transparency from 0-1