public class ColorOps
extends java.lang.Object
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
|
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