Enum AsciiColorPalette



  • public enum AsciiColorPalette
    extends java.lang.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 Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AsciiColorPalette fromPaletteName​(java.lang.String aPaletteName)
      Retrieves the enumeration element representing the given palette name (ignoring the case) or null if none was found.
      char[] getPalette​()
      Returns the palette for the according enumeration element.
      char[] toInverse​()
      Returns the palette for the according enumeration element.
      static AsciiColorPalette valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static AsciiColorPalette[] values​()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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​(java.lang.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.