| Modifier and Type | Field and Description |
|---|---|
| public float | a
the red, green, blue and alpha components |
| public float | b
the red, green, blue and alpha components |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public float | g
the red, green, blue and alpha components |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public float | r
the red, green, blue and alpha components |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final Color | |
| public static final float | WHITE_FLOAT_BITS
Convenience for frequently used |
| public static final Color |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Color(float
the red component r, float the green component g, float the blue component b, float the alpha component a)Constructor, sets the components of the color |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | abgr8888ToColor(Color
The Color to be modified. color, int value)Sets the Color components using the specified integer value in the format ABGR8888. |
| public static void | abgr8888ToColor(Color
The Color to be modified. color, float value)Sets the Color components using the specified float value in the format ABGR8888. |
| public Color | |
| public Color | Returns: this Color for chainingRed component r, float Green component g, float Blue component b, float Alpha component a)Adds the given color component values to this Color's values. |
| public static int | |
| public static int | |
| public static int | |
| public static void | argb8888ToColor(Color
The Color to be modified. color, int An integer color value in ARGB8888 format. value)Sets the Color components using the specified integer value in the format ARGB8888. |
| public Color | |
| public Color | |
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Color | Returns: The modified Color for chaining.The Hue in degree from 0 to 360 h, float The Saturation from 0 to 1 s, float The Value (brightness) from 0 to 1 v)Sets the RGB Color components using the specified Hue-Saturation-Value. |
| public Color | Returns: The modified Color for chaining.The Hue, Saturation and Value components in that order. hsv)Sets RGB components using the specified Hue-Saturation-Value. |
| public int | |
| public Color | |
| public Color | Returns: This color for chaining.The red component of the target color r, final float The green component of the target color g, final float The blue component of the target color b, final float The alpha component of the target color a, final float The interpolation coefficient t)Linearly interpolates between this color and the target color by t which is in the range [0,1]. |
| public static int | |
| public Color | |
| public Color | Returns: this colorthe value value)Multiplies all components of this Color with the given value. |
| public Color | Returns: this Color for chainingRed component r, float Green component g, float Blue component b, float Alpha component a)Multiplies this Color's color components by the given ones. |
| public Color | |
| public static int | |
| public static int | |
| public static void | rgb565ToColor(Color
The Color to be modified. color, int An integer color value in RGB565 format. value)Sets the Color components using the specified integer value in the format RGB565. |
| public static int | |
| public static int | |
| public static void | rgb888ToColor(Color
The Color to be modified. color, int An integer color value in RGB888 format. value)Sets the Color components using the specified integer value in the format RGB888. |
| public static int | |
| public static int | |
| public static void | rgba4444ToColor(Color
The Color to be modified. color, int An integer color value in RGBA4444 format. value)Sets the Color components using the specified integer value in the format RGBA4444. |
| public static int | |
| public static int | |
| public static void | rgba8888ToColor(Color
The Color to be modified. color, int An integer color value in RGBA8888 format. value)Sets the Color components using the specified integer value in the format RGBA8888. |
| public Color | |
| public Color | |
| public Color | Returns: this Color for chainingRed component r, float Green component g, float Blue component b, float Alpha component a)Sets this Color's component values. |
| public Color | Returns: this Color for chainingSets this color's component values through an integer representation. |
| public Color | |
| public Color | Returns: this Color for chainingRed component r, float Green component g, float Blue component b, float Alpha component a)Subtracts the given values from this Color's component values. |
| public float | Returns: the packed color as a 32-bit floatPacks the color components into a 32-bit integer with the format ABGR and then converts it to a float. |
| public static float | Returns: the packed color as a floatthe red component, 0 - 255 r, int the green component, 0 - 255 g, int the blue component, 0 - 255 b, int the alpha component, 0 - 255 a)Packs the color components into a 32-bit integer with the format ABGR and then converts it to a float. |
| public static float | Returns: the packed color as a 32-bit floatPacks the color components into a 32-bit integer with the format ABGR and then converts it to a float. |
| public float[] | Returns: HSV components for chaining.The HSV array to be modified. hsv)Extract Hue-Saturation-Value. |
| public int | Returns: the packed color as a 32-bit int.Packs the color components into a 32-bit integer with the format ABGR. |
| public static int | Returns: the packed color as a 32-bit intthe red component, 0 - 255 r, int the green component, 0 - 255 g, int the blue component, 0 - 255 b, int the alpha component, 0 - 255 a)Packs the color components into a 32-bit integer with the format ABGR. |
| public String | toString()
Overrides java. Returns the color encoded as hex string with the format RRGGBBAA. |
| public static Color | |
| public static Color |
| a | back to summary |
|---|---|
| public float a the red, green, blue and alpha components | |
| b | back to summary |
|---|---|
| public float b the red, green, blue and alpha components | |
| BLACK | back to summary |
|---|---|
| public static final Color BLACK | |
| BLUE | back to summary |
|---|---|
| public static final Color BLUE | |
| BROWN | back to summary |
|---|---|
| public static final Color BROWN | |
| CHARTREUSE | back to summary |
|---|---|
| public static final Color CHARTREUSE | |
| CLEAR | back to summary |
|---|---|
| public static final Color CLEAR | |
| CLEAR_WHITE | back to summary |
|---|---|
| public static final Color CLEAR_WHITE | |
| CORAL | back to summary |
|---|---|
| public static final Color CORAL | |
| CYAN | back to summary |
|---|---|
| public static final Color CYAN | |
| DARK_GRAY | back to summary |
|---|---|
| public static final Color DARK_GRAY | |
| FIREBRICK | back to summary |
|---|---|
| public static final Color FIREBRICK | |
| FOREST | back to summary |
|---|---|
| public static final Color FOREST | |
| g | back to summary |
|---|---|
| public float g the red, green, blue and alpha components | |
| GOLD | back to summary |
|---|---|
| public static final Color GOLD | |
| GOLDENROD | back to summary |
|---|---|
| public static final Color GOLDENROD | |
| GRAY | back to summary |
|---|---|
| public static final Color GRAY | |
| GREEN | back to summary |
|---|---|
| public static final Color GREEN | |
| LIGHT_GRAY | back to summary |
|---|---|
| public static final Color LIGHT_GRAY | |
| LIME | back to summary |
|---|---|
| public static final Color LIME | |
| MAGENTA | back to summary |
|---|---|
| public static final Color MAGENTA | |
| MAROON | back to summary |
|---|---|
| public static final Color MAROON | |
| NAVY | back to summary |
|---|---|
| public static final Color NAVY | |
| OLIVE | back to summary |
|---|---|
| public static final Color OLIVE | |
| ORANGE | back to summary |
|---|---|
| public static final Color ORANGE | |
| PINK | back to summary |
|---|---|
| public static final Color PINK | |
| PURPLE | back to summary |
|---|---|
| public static final Color PURPLE | |
| r | back to summary |
|---|---|
| public float r the red, green, blue and alpha components | |
| RED | back to summary |
|---|---|
| public static final Color RED | |
| ROYAL | back to summary |
|---|---|
| public static final Color ROYAL | |
| SALMON | back to summary |
|---|---|
| public static final Color SALMON | |
| SCARLET | back to summary |
|---|---|
| public static final Color SCARLET | |
| SKY | back to summary |
|---|---|
| public static final Color SKY | |
| SLATE | back to summary |
|---|---|
| public static final Color SLATE | |
| TAN | back to summary |
|---|---|
| public static final Color TAN | |
| TEAL | back to summary |
|---|---|
| public static final Color TEAL | |
| VIOLET | back to summary |
|---|---|
| public static final Color VIOLET | |
| WHITE | back to summary |
|---|---|
| public static final Color WHITE | |
| WHITE_FLOAT_BITS | back to summary |
|---|---|
| public static final float WHITE_FLOAT_BITS Convenience for frequently used | |
| YELLOW | back to summary |
|---|---|
| public static final Color YELLOW | |
| Color | back to summary |
|---|---|
| public Color() Constructs a new Color with all components set to 0. | |
| Color | back to summary |
|---|---|
public Color(int rgba8888)
| |
| Color | back to summary |
|---|---|
| public Color(float r, float g, float b, float a) Constructor, sets the components of the color
| |
| Color | back to summary |
|---|---|
| public Color(Color color) Constructs a new color using the given color
| |
| abgr8888ToColor | back to summary |
|---|---|
| public static void abgr8888ToColor(Color color, int value) Sets the Color components using the specified integer value in the format ABGR8888.
| |
| abgr8888ToColor | back to summary |
|---|---|
| public static void abgr8888ToColor(Color color, float value) Sets the Color components using the specified float value in the format ABGR8888.
| |
| add | back to summary |
|---|---|
| public Color add(Color color) Adds the given color to this color. | |
| add | back to summary |
|---|---|
| public Color add(float r, float g, float b, float a) Adds the given color component values to this Color's values.
| |
| alpha | back to summary |
|---|---|
| public static int alpha(float alpha) | |
| argb8888 | back to summary |
|---|---|
| public static int argb8888(float a, float r, float g, float b) | |
| argb8888 | back to summary |
|---|---|
| public static int argb8888(Color color) | |
| argb8888ToColor | back to summary |
|---|---|
| public static void argb8888ToColor(Color color, int value) Sets the Color components using the specified integer value in the format ARGB8888. This is the inverse to the argb8888(a, r, g, b) method
| |
| clamp | back to summary |
|---|---|
| public Color clamp() Clamps this Color's components to a valid range [0 - 1]
| |
| cpy | back to summary |
|---|---|
public Color cpy()
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| fromHsv | back to summary |
|---|---|
| public Color fromHsv(float h, float s, float v) Sets the RGB Color components using the specified Hue-Saturation-Value. Note that HSV components are voluntary not clamped to preserve high range color and can range beyond typical values.
| |
| fromHsv | back to summary |
|---|---|
| public Color fromHsv(float[] hsv) Sets RGB components using the specified Hue-Saturation-Value. This is a convenient method for
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| lerp | back to summary |
|---|---|
| public Color lerp(final Color target, final float t) Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in this color. | |
| lerp | back to summary |
|---|---|
| public Color lerp(final float r, final float g, final float b, final float a, final float t) Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in this color.
| |
| luminanceAlpha | back to summary |
|---|---|
| public static int luminanceAlpha(float luminance, float alpha) | |
| mul | back to summary |
|---|---|
| public Color mul(Color color) Multiplies this color and the given color | |
| mul | back to summary |
|---|---|
| public Color mul(float value) Multiplies all components of this Color with the given value.
| |
| mul | back to summary |
|---|---|
| public Color mul(float r, float g, float b, float a) Multiplies this Color's color components by the given ones.
| |
| premultiplyAlpha | back to summary |
|---|---|
| public Color premultiplyAlpha() Multiplies the RGB values by the alpha. | |
| rgb565 | back to summary |
|---|---|
| public static int rgb565(float r, float g, float b) | |
| rgb565 | back to summary |
|---|---|
| public static int rgb565(Color color) | |
| rgb565ToColor | back to summary |
|---|---|
| public static void rgb565ToColor(Color color, int value) Sets the Color components using the specified integer value in the format RGB565. This is inverse to the rgb565(r, g, b) method.
| |
| rgb888 | back to summary |
|---|---|
| public static int rgb888(float r, float g, float b) | |
| rgb888 | back to summary |
|---|---|
| public static int rgb888(Color color) | |
| rgb888ToColor | back to summary |
|---|---|
| public static void rgb888ToColor(Color color, int value) Sets the Color components using the specified integer value in the format RGB888. This is inverse to the rgb888(r, g, b) method.
| |
| rgba4444 | back to summary |
|---|---|
| public static int rgba4444(float r, float g, float b, float a) | |
| rgba4444 | back to summary |
|---|---|
| public static int rgba4444(Color color) | |
| rgba4444ToColor | back to summary |
|---|---|
| public static void rgba4444ToColor(Color color, int value) Sets the Color components using the specified integer value in the format RGBA4444. This is inverse to the rgba4444(r, g, b, a) method.
| |
| rgba8888 | back to summary |
|---|---|
| public static int rgba8888(float r, float g, float b, float a) | |
| rgba8888 | back to summary |
|---|---|
| public static int rgba8888(Color color) | |
| rgba8888ToColor | back to summary |
|---|---|
| public static void rgba8888ToColor(Color color, int value) Sets the Color components using the specified integer value in the format RGBA8888. This is inverse to the rgba8888(r, g, b, a) method.
| |
| set | back to summary |
|---|---|
| public Color set(Color color) Sets this color to the given color. | |
| set | back to summary |
|---|---|
| public Color set(Color rgb, float alpha) Sets this color to the red, green and blue components of the provided Color and a deviating alpha value. | |
| set | back to summary |
|---|---|
| public Color set(float r, float g, float b, float a) Sets this Color's component values.
| |
| set | back to summary |
|---|---|
| public Color set(int rgba) Sets this color's component values through an integer representation.
| |
| sub | back to summary |
|---|---|
| public Color sub(Color color) Subtracts the given color from this color | |
| sub | back to summary |
|---|---|
| public Color sub(float r, float g, float b, float a) Subtracts the given values from this Color's component values.
| |
| toFloatBits | back to summary |
|---|---|
| public float toFloatBits() Packs the color components into a 32-bit integer with the format ABGR and then converts it to a float. Alpha is compressed
from 0-255 to use only even numbers between 0-254 to avoid using float bits in the NaN range (see
| |
| toFloatBits | back to summary |
|---|---|
| public static float toFloatBits(int r, int g, int b, int a) Packs the color components into a 32-bit integer with the format ABGR and then converts it to a float. Note that no range checking is performed for higher performance.
| |
| toFloatBits | back to summary |
|---|---|
| public static float toFloatBits(float r, float g, float b, float a) Packs the color components into a 32-bit integer with the format ABGR and then converts it to a float.
| |
| toHsv | back to summary |
|---|---|
| public float[] toHsv(float[] hsv) Extract Hue-Saturation-Value. This is the inverse of
| |
| toIntBits | back to summary |
|---|---|
| public int toIntBits() Packs the color components into a 32-bit integer with the format ABGR.
| |
| toIntBits | back to summary |
|---|---|
| public static int toIntBits(int r, int g, int b, int a) Packs the color components into a 32-bit integer with the format ABGR. Note that no range checking is performed for higher performance.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the color encoded as hex string with the format RRGGBBAA. | |
| valueOf | back to summary |
|---|---|
| public static Color valueOf(String hex) Returns a new color from a hex string with the format RRGGBBAA.
| |
| valueOf | back to summary |
|---|---|
| public static Color valueOf(String hex, Color color) Sets the specified color from a hex string with the format RRGGBBAA.
| |