Enum Swatch

  • All Implemented Interfaces:
    Serializable, Comparable<Swatch>

    public enum Swatch
    extends Enum<Swatch>
    An enumeration of all available swatch styles provided by Glisten. A swatch is simply a color scheme that can be applied to Glisten applications. The default swatch is blue.
    Since:
    1.0.0
    See Also:
    Theme
    • Enum Constant Detail

      • BLUE

        public static final Swatch BLUE
      • CYAN

        public static final Swatch CYAN
      • DEEP_ORANGE

        public static final Swatch DEEP_ORANGE
      • DEEP_PURPLE

        public static final Swatch DEEP_PURPLE
      • GREEN

        public static final Swatch GREEN
      • INDIGO

        public static final Swatch INDIGO
      • LIGHT_BLUE

        public static final Swatch LIGHT_BLUE
      • PINK

        public static final Swatch PINK
      • PURPLE

        public static final Swatch PURPLE
      • RED

        public static final Swatch RED
      • TEAL

        public static final Swatch TEAL
      • LIGHT_GREEN

        public static final Swatch LIGHT_GREEN
      • LIME

        public static final Swatch LIME
      • YELLOW

        public static final Swatch YELLOW
      • AMBER

        public static final Swatch AMBER
      • ORANGE

        public static final Swatch ORANGE
      • BROWN

        public static final Swatch BROWN
      • GREY

        public static final Swatch GREY
      • BLUE_GREY

        public static final Swatch BLUE_GREY
    • Method Detail

      • values

        public static Swatch[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Swatch c : Swatch.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Swatch valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • assignTo

        public void assignTo​(Scene scene)
        Call this method to apply the selected swatch to the given Scene.
        Parameters:
        scene - The scene on which to apply the selected swatch.
      • getColor

        public Color getColor​(SwatchElement element)
        Return swatch color according to provided SwatchElement
        Parameters:
        element - The SwatchElement whose swatch color is to be determined.
        Returns:
        Color or null if element is not found
      • getDefault

        public static Swatch getDefault()
        Returns the hardcoded default swatch - blue.
        Returns:
        The hardcoded default swatch - blue.
      • getRandom

        public static Swatch getRandom()
        Returns a randomly selected swatch.
        Returns:
        A randomly selected swatch.