|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.util.ColorFactory
public class ColorFactory
The idea of this class is to produce any number of colors, but the colors should be different to one another so that they can be picked out visually in a chart.
Constructor Summary | |
---|---|
ColorFactory()
|
|
ColorFactory(Color... initialColors)
Sets up a predetermined sequence of colors to use initially |
|
ColorFactory(int transparency,
Color... initialColors)
This constructor allows you to set the transparency of the generated colors as well as provide a sequence of colors to use initially |
Method Summary | |
---|---|
void |
clear()
|
double |
closest(Color color)
Returns the distance of the closest color generated |
Color |
create()
|
static double |
distance(Color color1,
Color color2)
The distance measure between the two supplied colors in red, green, blue space. |
int |
getTransparency()
|
static Color |
intensify(Color c,
int offset)
Intensify a colour by applying the supplied offset |
static Color |
intensify2(Color c,
int offset)
This method of intensifying a colour distributes intensity wherever it can. |
void |
setTransparency(int transparency)
Sets the transparency value |
static Color |
transitionColor(Color fromColor,
Color toColor,
double position)
Create a color that lies on the 'color line' between the supplied fromColor and toColor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorFactory()
public ColorFactory(int transparency, Color... initialColors)
transparency
- a value between 0 (transparent) and 255 (opaque)initialColors
- the first colours to use in the generated sequencepublic ColorFactory(Color... initialColors)
initialColors
- the colors to start withMethod Detail |
---|
public void clear()
public int getTransparency()
public void setTransparency(int transparency)
transparency
- the new transparency valuepublic static double distance(Color color1, Color color2)
color1
- a colorcolor2
- another color
public double closest(Color color)
color
- the color of interest
distance(color, color)
method.public Color create()
public static Color intensify(Color c, int offset)
c
- the original colouroffset
- a value between -255 and 255 to add to each of the rgb components
public static Color intensify2(Color c, int offset)
c
- the original coloroffset
- the amount by which to change the color, in the range 0 to 255
Color
objectpublic static Color transitionColor(Color fromColor, Color toColor, double position)
fromColor
- one point at the end of the color linetoColor
- another point at the end of the color lineposition
- the position along the color line
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |