public final class ColorUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Color |
fromHex(String hex)
Returns color decoded from a hex color string.
|
static Color |
fromRGBA(String rgba)
Returns
Color decoded from RGBA color string. |
static Color |
fromRGBA(String rgba,
String separator)
Returns
Color decoded from RGBA color string. |
static Color |
grayscale(Color color)
Returns grayscale version of the specified
Color. |
static Color |
intermediate(Color color1,
Color color2,
float progress)
|
static Color |
opaque(Color color)
Returns
Color with alpha value set to 255. |
static Color |
softColor(Color base)
|
static String |
toHex(Color color)
Returns hex string for the specified
Color. |
static String |
toRGBA(Color color)
Returns RGBA color string for the specified
Color. |
static String |
toRGBA(Color color,
String separator)
Returns RGBA color string for the specified
Color. |
static Color |
transparent()
Returns fully transparent white
Color. |
static Color |
transparent(Color color,
int alpha)
Returns
Color with modified alpha value. |
static Color |
webSafe(Color color)
Returns web-safe
Color. |
static int |
webSafe(int value)
Returns web-safe color value.
|
@NotNull public static Color transparent()
Color.Color@NotNull public static Color grayscale(@NotNull Color color)
Color.@NotNull public static Color transparent(@NotNull Color color, int alpha)
Color with modified alpha value.@NotNull public static Color opaque(@NotNull Color color)
Color with alpha value set to 255.public static int webSafe(int value)
value - value to process@NotNull public static Color intermediate(@NotNull Color color1, @NotNull Color color2, float progress)
@NotNull public static String toHex(@NotNull Color color)
Color.@NotNull public static Color fromHex(@NotNull String hex)
hex - hex color string@NotNull public static String toRGBA(@NotNull Color color)
Color.@NotNull public static String toRGBA(@NotNull Color color, @NotNull String separator)
Color.@NotNull public static Color fromRGBA(@NotNull String rgba)
Color decoded from RGBA color string.rgba - RGBA color stringColor decoded from RGBA color string@NotNull public static Color fromRGBA(@NotNull String rgba, @NotNull String separator)
Color decoded from RGBA color string.rgba - RGBA color stringseparator - color values separatorColor decoded from RGBA color stringCopyright © 2020. All rights reserved.