Class Colors


  • public final class Colors
    extends java.lang.Object
    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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Color get​(java.lang.String name)
      Convenience method to lookup a color by name.
      static ObjectMap<java.lang.String,​Color> getColors()
      Returns the color map.
      static Color put​(java.lang.String name, Color color)
      Convenience method to add a color with its name.
      static void reset()
      Resets the color map to the predefined colors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getColors

        public static ObjectMap<java.lang.String,​Color> getColors()
        Returns the color map.
      • get

        public static Color get​(java.lang.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 - the name of the color
        Returns:
        the color to which the specified name is mapped, or null if there was no mapping for name .
      • put

        public static Color put​(java.lang.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 - the name of the color
        color - the color
        Returns:
        the previous color associated with name, or null if there was no mapping for name .
      • reset

        public static void reset()
        Resets the color map to the predefined colors.