Enum EColorPalette

  • All Implemented Interfaces:
    Serializable, Comparable<EColorPalette>

    @Immutable
    public enum EColorPalette
    extends Enum<EColorPalette>
    Enumeration of available color palettes for the web. Each color palette consists of n colors, a CSS color property, and a style class for applying that color.
    Since:
    6.5.0
    Author:
    XIMA MEDIA GmbH
    • Enum Constant Detail

      • QUASAR_COLORED_BALANCED

        public static final EColorPalette QUASAR_COLORED_BALANCED
        Quasar color palette, balanced so that they can be used as a text color on a white background and as a background for white text.
    • Method Detail

      • values

        public static EColorPalette[] 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 (EColorPalette c : EColorPalette.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EColorPalette 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
      • getColor

        public IGuiColor getColor​(int index)
        Parameters:
        index - Index of the color.
        Returns:
        The color at the given index. The index is shifted to the number of available colors, so no IndexOutOfBoundsException is thrown.
      • getColorCount

        public int getColorCount()
        Returns:
        The number of colors in this palette.
      • getColors

        public com.google.common.collect.ImmutableList<IGuiColor> getColors()
        Returns:
        An immutable list of all colors in this palette.
      • getRandom

        public IGuiColor getRandom()
        Returns:
        A random color of this palette.
      • getShuffledColor

        public IGuiColor getShuffledColor​(int index)
        Parameters:
        index - Index of the color.
        Returns:
        The color at the given index. The index is shifted to the number of available colors, so no IndexOutOfBoundsException is thrown. The colors are shuffled, in a random order determined at startup.
      • getShuffledColors

        public com.google.common.collect.ImmutableList<IGuiColor> getShuffledColors()
        Returns:
        An immutable list of all colors in this palette, in a random order determined at startup.
      • supportsField

        public boolean supportsField​(IColorField<?> field)
        Checks whether the given color palette field is support by the entries of this palette. When this returns false for a certain IColorField, IGuiColor.getField(IColorField) will throw an exception when called with that field. Otherwise, when this returns true, a value is available for all getColors() of this palette.
        Parameters:
        field - A field to check.
        Returns:
        Whether the given color palette field is support by the entries of this palette.