public interface ColorLookup
DESCRIPTIVE, which allows using multiple color names, plus adjectives. There
is also INSTANCE, which is older and only looks up one color name at a time from Colors in libGDX.| Modifier and Type | Interface and Description |
|---|---|
static class |
ColorLookup.GdxColorLookup
The default ColorLookup, this simply looks up
key in Colors, returning 256 (fully transparent,
extremely dark blue) if no Color exists by that exact name (case-sensitive), or returning the RGBA8888 value
of the color otherwise. |
| Modifier and Type | Field and Description |
|---|---|
static ColorLookup |
DESCRIPTIVE
An alternative ColorLookup, this parses a description such as "peach red" or "DARK DULLEST GREEN" using
ColorUtils.describe(String) (See its docs for more information). |
static ColorLookup.GdxColorLookup |
INSTANCE
The default ColorLookup, this simply looks up
key in Colors. |
| Modifier and Type | Method and Description |
|---|---|
int |
getRgba(java.lang.String key)
Uses
key to look up an RGBA8888 color, and returns that color as an int if one was found, or returns
256 if none was found. |
static final ColorLookup.GdxColorLookup INSTANCE
key in Colors. It returns 256 (fully transparent,
extremely dark blue) if no Color exists by that exact name (case-sensitive), or returning the RGBA8888 value
of the color otherwise. All color names are ALL_CAPS in libGDX's Colors collection by default.
This can also be accessed with ColorLookup.GdxColorLookup.INSTANCE.static final ColorLookup DESCRIPTIVE
ColorUtils.describe(String) (See its docs for more information). The colors available are in
Palette; the adjectives this can use are "light", "dark", "rich",
"dull", and all versions of those with the suffixes "-er", "-est", or "-most". Case is effectively ignored for
adjectives, but in some cases it can matter for color names -- ALL_CAPS names are ones from the libGDX class
Colors, while lowercase ones are defined by this library.int getRgba(java.lang.String key)
key to look up an RGBA8888 color, and returns that color as an int if one was found, or returns
256 if none was found. 256 is used because it is different from the more commonly-used 0 for fully-transparent,
while still being easy to remember and very rare to ever want (it is fully transparent, very dark blue). This
library will never call this method with a null key, and in most cases you can safely assume key is non-null.key - the String key to use to look up or build a color; should not be null.