Enum AsciiColorPalette

java.lang.Object
java.lang.Enum<AsciiColorPalette>
org.refcodes.data.AsciiColorPalette
All Implemented Interfaces:
Serializable, Comparable<AsciiColorPalette>, java.lang.constant.Constable

public enum AsciiColorPalette extends Enum<AsciiColorPalette>
An enumeration for text palette definitions to make it easy working with such default palettes. Such palettes can be used when drawing ASCII art, each character element in a palette represents a gray scale, from bright (first element) to dark (last element).
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    This palate contains block characters representing shade patterns from white to black representing gray scale colors in terms of ASCII art.
    This palate contains the full set of characters from white to black representing gray scale colors in terms of ASCII art.
    This palate contains a minimal set of characters from white to black representing gray scale colors in terms of ASCII art.
    This palate contains block characters representing shade patterns from white to black representing gray scale colors in terms of ASCII art.
    This palate contains a normal set of characters from white to black representing gray scale colors in terms of ASCII art.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromPaletteName(String aPaletteName)
    Retrieves the enumeration element representing the given palette name (ignoring the case) or null if none was found.
    char[]
    Returns the palette for the according enumeration element.
    char[]
    Returns the palette for the according enumeration element.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • MIN_LEVEL_GRAY

      public static final AsciiColorPalette MIN_LEVEL_GRAY
      This palate contains a minimal set of characters from white to black representing gray scale colors in terms of ASCII art.
    • NORM_LEVEL_GRAY

      public static final AsciiColorPalette NORM_LEVEL_GRAY
      This palate contains a normal set of characters from white to black representing gray scale colors in terms of ASCII art.
    • MAX_LEVEL_GRAY

      public static final AsciiColorPalette MAX_LEVEL_GRAY
      This palate contains the full set of characters from white to black representing gray scale colors in terms of ASCII art.
    • HALFTONE_GRAY

      public static final AsciiColorPalette HALFTONE_GRAY
      This palate contains block characters representing shade patterns from white to black representing gray scale colors in terms of ASCII art.
    • MONOCHROME

      public static final AsciiColorPalette MONOCHROME
      This palate contains block characters representing shade patterns from white to black representing gray scale colors in terms of ASCII art.
  • Method Details

    • values

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

      public static AsciiColorPalette 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
    • getPalette

      public char[] getPalette()
      Returns the palette for the according enumeration element.
      Returns:
      The according palette.
    • toInverse

      public char[] toInverse()
      Returns the palette for the according enumeration element.
      Returns:
      The according palette.
    • fromPaletteName

      public static AsciiColorPalette fromPaletteName(String aPaletteName)
      Retrieves the enumeration element representing the given palette name (ignoring the case) or null if none was found.
      Parameters:
      aPaletteName - The palette name for which to get the enumeration element.
      Returns:
      The enumeration element determined or null if none matching was found.