Enum AsciiColorPalette

  • All Implemented Interfaces:
    Serializable, Comparable<AsciiColorPalette>

    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).
    • Enum Constant Detail

      • 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 Detail

      • values

        public static AsciiColorPalette[] 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 (AsciiColorPalette c : AsciiColorPalette.values())
            System.out.println(c);
        
        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.