|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.util.ColorGenerator
public final class ColorGenerator
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);
Color,
Collection,
List,
gatherBlackAndWhite(),
gatherBaseColors(),
gatherBaseMoleculeColors(boolean),
gatherBaseColorsAndBaseMoleculeColors(boolean)| Constructor Summary | |
|---|---|
ColorGenerator()
|
|
| Method Summary | |
|---|---|
static java.util.Collection<java.awt.Color> |
gatherBaseColors()
Creates a Collection of the base colors. |
static java.util.Collection<java.awt.Color> |
gatherBaseColorsAndBaseMoleculeColors(boolean onLightBackground)
Creates a Collection of the base Molecule RGB colors and base
colors. |
static java.util.Collection<java.awt.Color> |
gatherBaseMoleculeColors(boolean onLightBackground)
Creates a Collection of the base Molecule RGB colors. |
static java.util.Collection<java.awt.Color> |
gatherBlackAndWhite()
Creates a Collection of black and white color |
static java.util.List<java.awt.Color> |
generateColors(int count)
Generates the specified number of different Colors, with no
forbidden colors. |
static java.util.List<java.awt.Color> |
generateColors(int count,
java.util.Collection<java.awt.Color> forbiddenColors)
Generates the specified number of different Colors, which are
different enough from the specified forbidden colors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColorGenerator()
| Method Detail |
|---|
public static final java.util.List<java.awt.Color> generateColors(int count,
java.util.Collection<java.awt.Color> forbiddenColors)
Colors, which are
different enough from the specified forbidden colors. If there are too
many forbidden and required colors (greater than 224), this
function throws IllegalArgumentException.
count - the number of the required colors between 1 and 224forbiddenColors - the forbidden colors or null
List of the generated ColorsgatherBlackAndWhite(),
gatherBaseColors(),
gatherBaseMoleculeColors(boolean),
gatherBaseColorsAndBaseMoleculeColors(boolean),
Colorpublic static final java.util.List<java.awt.Color> generateColors(int count)
Colors, with no
forbidden colors. If there are too many required colors (greater than
224), this function throws IllegalArgumentException.
count - the number of the required colors between 1 and 224
List of the generated Colorspublic static final java.util.Collection<java.awt.Color> gatherBaseColors()
Collection of the base colors.
gatherBlackAndWhite(),
gatherBaseMoleculeColors(boolean),
gatherBaseColorsAndBaseMoleculeColors(boolean),
Colorpublic static final java.util.Collection<java.awt.Color> gatherBaseMoleculeColors(boolean onLightBackground)
Collection of the base Molecule RGB colors.
onLightBackground - true if the colors will be displayed on a light background,
false if not.
gatherBlackAndWhite(),
gatherBaseColors(),
gatherBaseColorsAndBaseMoleculeColors(boolean),
Colorpublic static final java.util.Collection<java.awt.Color> gatherBaseColorsAndBaseMoleculeColors(boolean onLightBackground)
Collection of the base Molecule RGB colors and base
colors.
onLightBackground - true if the colors will be displayed on a light background,
false if not.
gatherBlackAndWhite(),
gatherBaseColors(),
gatherBaseMoleculeColors(boolean),
Colorpublic static final java.util.Collection<java.awt.Color> gatherBlackAndWhite()
Collection of black and white color
gatherBaseColors(),
gatherBaseMoleculeColors(boolean),
gatherBaseColorsAndBaseMoleculeColors(boolean),
Color
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||