APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics

public final Class Colors

extends Object
Class Inheritance
Imports
com.badlogic.gdx.utils.ObjectMap

A general purpose class containing named colors that can be changed at will. For example, the markup language defined by the BitmapFontCache class uses this class to retrieve colors and the user can define his own colors.
Author
davebaol

Field Summary

Modifier and TypeField and Description
private static final ObjectMap<String, Color>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Color

Returns:

the color to which the specified name is mapped, or null if there was no mapping for name .
get
(String
the name of the color
name
)

Convenience method to lookup a color by name.

public static ObjectMap<String, Color>
getColors()

Returns the color map.

public static Color

Returns:

the previous color associated with name, or null if there was no mapping for name .
put
(String
the name of the color
name
,
Color
the color
color
)

Convenience method to add a color with its name.

public static void
reset()

Resets the color map to the predefined colors.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private static final ObjectMap<String, Color> map

Constructor Detail

Colorsback to summary
private Colors()

Method Detail

getback to summary
public static Color get(String name)

Convenience method to lookup a color by name. The invocation of this method is equivalent to the expression Colors.getColors().get(name)

Parameters
name:String

the name of the color

Returns:Color

the color to which the specified name is mapped, or null if there was no mapping for name .

getColorsback to summary
public static ObjectMap<String, Color> getColors()

Returns the color map.

putback to summary
public static Color put(String name, Color color)

Convenience method to add a color with its name. The invocation of this method is equivalent to the expression Colors.getColors().put(name, color)

Parameters
name:String

the name of the color

color:Color

the color

Returns:Color

the previous color associated with name, or null if there was no mapping for name .

resetback to summary
public static void reset()

Resets the color map to the predefined colors.