Class MultiColorGenerator

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, ColorGradientGenerator, Serializable, Comparable

    public class MultiColorGenerator
    extends AbstractColorGradientGenerator
    Generates gradient colors between multiple colors.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -num-colors <int> (property: numColors)
        The number of colors in the gradient to use.
        default: 255
        minimum: 1
     
    -color <java.awt.Color> [-color ...] (property: colors)
        The colors to use for the gradient.
        default: #0000b2, #00b200, #b20000, #ffff00
     
    -alpha <int> (property: alpha)
        The alpha value to use (0=transparent, 255=opaque); ignored if 255.
        default: 255
        minimum: 0
        maximum: 255
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_NumColors

        protected int m_NumColors
        the number of gradient colors.
      • m_Colors

        protected Color[] m_Colors
        the colors to create the gradient with.
      • m_Alpha

        protected int m_Alpha
        the alpha value to use (ignored if 255).
    • Constructor Detail

      • MultiColorGenerator

        public MultiColorGenerator()
    • Method Detail

      • setNumColors

        public void setNumColors​(int value)
        Sets the number of gradient colors to use.
        Parameters:
        value - the number of colors
      • getNumColors

        public int getNumColors()
        Returns the number of gradient colors to use.
        Returns:
        the number of colors
      • numColorsTipText

        public String numColorsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColors

        public void setColors​(Color[] value)
        Sets the colors of the gradient.
        Parameters:
        value - the colors
      • getColors

        public Color[] getColors()
        Returns the colors of the gradient.
        Returns:
        the colors
      • colorsTipText

        public String colorsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAlpha

        public void setAlpha​(int value)
        Sets the alpha value to use (0=transparent, 255=opaque); ignored if 255.
        Parameters:
        value - the alpha value
      • getAlpha

        public int getAlpha()
        Returns the alpha value to use (0=transparent, 255=opaque); ignored if 255.
        Returns:
        the alpha value
      • alphaTipText

        public String alphaTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.