public class MultiColor extends java.awt.Color
This class is designed to be immutable.
Constructor and Description |
---|
MultiColor(java.awt.Color primaryColor,
PairList<java.awt.Color,java.lang.Integer> colorDistribution)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor(int index)
Returns the color at the given index.
|
int |
getFrequency(int index)
Returns the absolute frequency of the color at the given index.
|
double |
getRelativeFrequency(int index)
Returns the relative frequency of the color at the given index.
|
int |
size()
Returns the number of colors in the distribution.
|
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
public MultiColor(java.awt.Color primaryColor, PairList<java.awt.Color,java.lang.Integer> colorDistribution)
primaryColor
- the primary color passed to code that does not support multi
colors.colorDistribution
- the color distribution. All entries must have a positive
integer and the list may not be empty.public int size()
public java.awt.Color getColor(int index)
public int getFrequency(int index)
public double getRelativeFrequency(int index)