public class ColorOps
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static double |
oneThirdRotation |
private static double |
twoThirdsRotation |
| Constructor and Description |
|---|
ColorOps() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Color |
darken(java.awt.Color c)
return a darker version of the given Color
|
static java.awt.Color |
getBrightColor()
Return a bright, saturated Color with a random hue
|
static java.awt.Color |
getBrightColor(double d)
Return a bright, saturated Color with a hue based on d
|
static java.awt.Color |
interpolate(java.awt.Color c1,
java.awt.Color c2,
float n)
Linearly interpolates between two colors based on n.
|
static java.awt.Color |
lighten(java.awt.Color c)
return a lighter version of the given Color
|
private static final double oneThirdRotation
private static final double twoThirdsRotation
public static java.awt.Color darken(java.awt.Color c)
c - the Color to darkenpublic static java.awt.Color lighten(java.awt.Color c)
c - the Color to lightenpublic static java.awt.Color interpolate(java.awt.Color c1,
java.awt.Color c2,
float n)
c1 - the first Colorc2 - the second Colorn - the ratio of c2 to usepublic static java.awt.Color getBrightColor()
public static java.awt.Color getBrightColor(double d)
d - the location along the rainbow to choose