| 
 
 | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectColorX
public class ColorX
Color utilities.
| Field Summary | |
|---|---|
static Color | 
TRANSPARENT
The entirely transparent colour, in the default sRGB space.  | 
| Method Summary | |
|---|---|
static float | 
brightness(Color color)
Returns the brightness of the color, per the HSB model.  | 
static float | 
hue(Color color)
Returns the hue of the color, per the HSB model.  | 
static Color | 
interBright(Color c0,
                       float b1,
                       float fraction)
Creates a colour intermediate between two other colours with respect to brightness.  | 
static Color | 
interColor(Color c0,
                     Color c1,
                     float fraction)
Creates a colour intermediate between two other colours.  | 
static Color | 
interHued(Color c0,
                   float h1,
                   float fraction)
Creates a colour intermediate between two other colours with respect to hue.  | 
static Color | 
interSaturated(Color c0,
                             float s1,
                             float fraction)
Creates a colour intermediate between two other colours with respect to saturation.  | 
static Color | 
offBright(Color color,
                   float fraction)
Returns a darker or brighter shade of the colour.  | 
static Color | 
offBright(Color color,
                   float fraction,
                   boolean isDark)
Returns a darker or brighter shade of the colour.  | 
static float | 
saturation(Color color)
Returns the saturation of the color, per the HSB model.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final Color TRANSPARENT
| Method Detail | 
|---|
public static float brightness(Color color)
public static float hue(Color color)
public static Color interBright(Color c0,
                                float b1,
                                float fraction)
c0 - first colourb1 - brightness of second colourfraction - along line from brightness of c0, to b1;
         where 0.0 (or less) returns c0, and 1.0 (or more) returns c0 with brightness b1,
         and anything in between returns a proportionately intermediate brightness
public static Color interColor(Color c0,
                               Color c1,
                               float fraction)
c0 - first colourc1 - second colourfraction - along line from c0 to c1;
         where 0.0 (or less) returns c0, and 1.0 (or more) returns c1,
         and anything in between returns a proportionately intermediate colour
public static Color interHued(Color c0,
                              float h1,
                              float fraction)
c0 - first colourh1 - hue of second colourfraction - along line from hue of c0, to h1;
         where 0.0 (or less) returns c0, and 1.0 (or more) returns c0 with hue h1,
         and anything in between returns a proportionately intermediate hue
public static Color interSaturated(Color c0,
                                   float s1,
                                   float fraction)
c0 - first colours1 - saturation of second colourfraction - along line from saturation of c0, to s1;
         where 0.0 (or less) returns c0, and 1.0 (or more) returns c0 with saturation s1,
         and anything in between returns a proportionately intermediate saturation
public static Color offBright(Color color,
                              float fraction)
     offBright( color, fraction, brightness(color) < 0.7f )
     
public static Color offBright(Color color,
                              float fraction,
                              boolean isDark)
fraction - to shade; where 0.0 (or less) returns the same (or equal) colour;
         and 1.0 (or more) returns the shade having the most extreme contrast;
         and intermediate values return intermediate shadesisDark - whether or not you consider the colour darkpublic static float saturation(Color color)
  | 
 
 | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||