Package com.badlogic.gdx.graphics
Class Colors
- java.lang.Object
-
- com.badlogic.gdx.graphics.Colors
-
public final class Colors extends java.lang.ObjectA general purpose class containing named colors that can be changed at will. For example, the markup language defined by theBitmapFontCacheclass uses this class to retrieve colors and the user can define his own colors.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Colorget(java.lang.String name)Convenience method to lookup a color byname.static ObjectMap<java.lang.String,Color>getColors()Returns the color map.static Colorput(java.lang.String name, Color color)Convenience method to add acolorwith itsname.static voidreset()Resets the color map to the predefined colors.
-
-
-
Method Detail
-
get
public static Color get(java.lang.String name)
Convenience method to lookup a color byname. The invocation of this method is equivalent to the expressionColors.getColors().get(name)- Parameters:
name- the name of the color- Returns:
- the color to which the specified
nameis mapped, ornullif there was no mapping forname.
-
put
public static Color put(java.lang.String name, Color color)
Convenience method to add acolorwith itsname. The invocation of this method is equivalent to the expressionColors.getColors().put(name, color)- Parameters:
name- the name of the colorcolor- the color- Returns:
- the previous
colorassociated withname, ornullif there was no mapping forname.
-
reset
public static void reset()
Resets the color map to the predefined colors.
-
-