public final class ColorUtils extends Object
Color conversion utilities methods.
The source code was adapted from a question on stack overflow.
| Modifier and Type | Method and Description |
|---|---|
static Color |
hsvToColor(float hue,
float saturation,
float value)
Conversion from the HSV color space to
Color. |
static int |
hsvToRgb(float hue,
float saturation,
float value)
Converts hue-saturation-value color space to red-green-blue integer
value representation.
|
static Color |
intToColor(int col)
Creates a
Color from an integer value |
static int |
rgbToInt(float r,
float g,
float b)
Converts an RGB color to its integer counterpart
|
public static Color hsvToColor(float hue, float saturation, float value)
Color.hue - hue of the original color (tint)saturation - the amount of color saturationvalue - value of the current colorColorpublic static int hsvToRgb(float hue,
float saturation,
float value)
hue - hue of the original color (tint)saturation - the amount of color saturationvalue - value of the current colorColorpublic static int rgbToInt(float r,
float g,
float b)
r - the red componentg - the green componentb - the blue componentCopyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d