Class AbstractColorProvider

    • Field Detail

      • MIN_VALUE

        public static final int MIN_VALUE
        the minimum value for R, G and B before restarting the color provider.
        See Also:
        Constant Field Values
      • m_Index

        protected int m_Index
        the current index.
      • m_FirstIteration

        protected boolean m_FirstIteration
        whether it is the first iteration.
      • m_Colors

        protected List<Color> m_Colors
        contains the current colors.
      • m_DefaultColors

        protected List<Color> m_DefaultColors
        contains the default colors.
      • m_RecycledColors

        protected List<Color> m_RecycledColors
        recycled, i.e., returned colors.
      • m_ExcludedColors

        protected List<Color> m_ExcludedColors
        excluded colors (already used).
      • m_AllowDarkening

        protected boolean m_AllowDarkening
        whether darkening of colors is allowed.
      • m_CheckTooDark

        protected boolean m_CheckTooDark
        whether to ensure that colors aren't too dark.
    • Constructor Detail

      • AbstractColorProvider

        public AbstractColorProvider()
    • Method Detail

      • next

        public Color next()
        Returns the next color.
        Specified by:
        next in interface ColorProvider
        Returns:
        the next color
      • recycle

        public void recycle​(Color c)
        "Recycles" the specified colors, i.e., makes it available for future use.
        Specified by:
        recycle in interface ColorProvider
        Parameters:
        c - the color to re-use
      • exclude

        public void exclude​(Color c)
        "Excludes" the specified colors, i.e., makes it unavailable for future use.
        Specified by:
        exclude in interface ColorProvider
        Parameters:
        c - the color to exclude
      • forName

        public static ColorProvider forName​(String classname,
                                            String[] options)
        Instantiates the provider with the given options.
        Parameters:
        classname - the classname of the provider to instantiate
        options - the options for the provider
        Returns:
        the instantiated provider or null if an error occurred
      • forCommandLine

        public static ColorProvider forCommandLine​(String cmdline)
        Instantiates the provider from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the provider to instantiate
        Returns:
        the instantiated provider or null if an error occurred