Package com.github.tommyettinger.textra
Interface ColorLookup
- All Known Implementing Classes:
ColorLookup.GdxColorLookup
public interface ColorLookup
Allows looking up an RGBA8888 Integer color given a String key, returning either the color or null if none was found.
This is an extension point for games and libraries that may want their own way of looking up colors.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe default ColorLookup, this simply looks upkeyinColors, returning null if no Color exists by that exact name (case-sensitive), or returning the RGBA8888 value of the color otherwise. -
Method Summary
-
Method Details
-
getRgba
Useskeyto look up an RGBA8888 color, and returns that color as an Integer if one was found, or returns null if none was found. This library will never call this method with a null key, and in most cases you can safely assume key is non-null.- Parameters:
key- the String key to use to look up or build a color; should not be null.- Returns:
- an RGBA8888 color that may be null.
-