Class ColorGenerator

  • @PublicAPI
    public final class ColorGenerator
    extends Object
    A final class which provides a static access to a color distant color creator class. The result will be a List of Colors which are distinguishable from each other and some specified other colors (typically from background colors). The order of the generated Colors is the same on the same collection of forbidden colors, regardless of the number of the required colors. This class also provides a few collections of colors, for gathering the most used forbidden colors.

    Usage example:

    If you need a n Colors without the most often used molecule label colors and without the base (red, green, blue, cyan magenta, yellow, black, white) colors, and you intend to use them on a light background:

    List<Color> colors =
         ColorGenerator.generateColors(n, gatherBaseColorsAndBaseMoleculeColors(true));

    If you need n colors without any constraints:

    List<Color> colors = ColorGenerator.generateColors(n);
    See Also:
    Color, Collection, List, gatherBlackAndWhite(), gatherBaseColors(), gatherBaseMoleculeColors(boolean), gatherBaseColorsAndBaseMoleculeColors(boolean)