Enum Class ColorStyle

java.lang.Object
java.lang.Enum<ColorStyle>
org.glavo.monetfx.ColorStyle
All Implemented Interfaces:
Serializable, Comparable<ColorStyle>, Constable

public enum ColorStyle extends Enum<ColorStyle>

The algorithm used to construct a ColorScheme in ColorScheme.fromSeed(javafx.scene.paint.Color).

The TONAL_SPOT style builds default Material scheme colors. These colors are mapped to light or dark tones to achieve visually accessible color pairings with sufficient contrast between foreground and background elements.

In some cases, the tones can prevent colors from appearing as intended, such as when a color is too light to offer enough contrast for accessibility. Color fidelity (ColorStyle.FIDELITY) is a feature that adjusts tones in these cases to produce the intended visual results without harming visual contrast.

  • Enum Constant Details

    • TONAL_SPOT

      public static final ColorStyle TONAL_SPOT
      Default for Material theme colors. Builds pastel palettes with a low chroma.
    • FIDELITY

      public static final ColorStyle FIDELITY
      The resulting color palettes match seed color, even if the seed color is very bright (high chroma).
    • MONOCHROME

      public static final ColorStyle MONOCHROME
      All colors are grayscale, no chroma.
    • NEUTRAL

      public static final ColorStyle NEUTRAL
      Close to grayscale, a hint of chroma.
    • VIBRANT

      public static final ColorStyle VIBRANT
      Pastel colors, high chroma palettes. The primary palette's chroma is at maximum. Use fidelity instead if tokens should alter their tone to match the palette vibrancy.
    • EXPRESSIVE

      public static final ColorStyle EXPRESSIVE
      Pastel colors, medium chroma palettes. The primary palette's hue is different from the seed color, for variety.
    • CONTENT

      public static final ColorStyle CONTENT
      Almost identical to fidelity. Tokens and palettes match the seed color. ColorScheme.getPrimaryContainer() is the seed color, adjusted to ensure contrast with surfaces. The tertiary palette is analogue of the seed color.
    • RAINBOW

      public static final ColorStyle RAINBOW
      A playful theme - the seed color's hue does not appear in the theme.
    • FRUIT_SALAD

      public static final ColorStyle FRUIT_SALAD
      A playful theme - the seed color's hue does not appear in the theme.
  • Method Details

    • values

      public static ColorStyle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ColorStyle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ColorStyle>