Package de.xima.fc.gui.common.enums
Enum EColorPalette
- java.lang.Object
-
- java.lang.Enum<EColorPalette>
-
- de.xima.fc.gui.common.enums.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 ofn
colors, a CSS color property, and a style class for applying that color.- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MRMRS_COLORED
Color palette from https://github.com/mrmrs/colors.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IGuiColor
getColor(int index)
int
getColorCount()
com.google.common.collect.ImmutableList<IGuiColor>
getColors()
IGuiColor
getRandom()
IGuiColor
getShuffledColor(int index)
com.google.common.collect.ImmutableList<IGuiColor>
getShuffledColors()
boolean
supportsField(IColorField<?> field)
Checks whether the given color palette field is support by the entries of this palette.static EColorPalette
valueOf(String name)
Returns the enum constant of this type with the specified name.static EColorPalette[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MRMRS_COLORED
public static final EColorPalette MRMRS_COLORED
Color palette from https://github.com/mrmrs/colors.
-
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 nameNullPointerException
- 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 returnsfalse
for a certainIColorField
,IGuiColor.getField(IColorField)
will throw an exception when called with that field. Otherwise, when this returnstrue
, a value is available for allgetColors()
of this palette.- Parameters:
field
- A field to check.- Returns:
- Whether the given color palette field is support by the entries of this palette.
-
-