public class ColorUtils
extends java.lang.Object
| Constructor and Description |
|---|
ColorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
distance(java.awt.Color color1,
java.awt.Color color2)
Get the distance between two colors.
|
static java.awt.Color |
getRainbowColor(int offset,
float divider)
Get a color calculated by the current time.
|
static java.awt.Color |
interpolate(java.awt.Color color1,
java.awt.Color color2,
float progress)
Interpolate between two colors with a progress.
|
static java.awt.Color |
multiply(java.awt.Color color,
float factor)
Multiply a color with a factor.
|
static java.awt.Color |
setAlpha(java.awt.Color color,
int a)
Set the alpha value of a color.
|
static java.awt.Color |
setBlue(java.awt.Color color,
int b)
Set the blue value of a color.
|
static java.awt.Color |
setGreen(java.awt.Color color,
int g)
Set the green value of a color.
|
static java.awt.Color |
setRed(java.awt.Color color,
int r)
Set the red value of a color.
|
public static java.awt.Color getRainbowColor(int offset,
float divider)
offset - The offset added to the current timedivider - The divider for the current timepublic static java.awt.Color setRed(java.awt.Color color,
int r)
color - The color to modifyr - The new red valuepublic static java.awt.Color setGreen(java.awt.Color color,
int g)
color - The color to modifyg - The new green valuepublic static java.awt.Color setBlue(java.awt.Color color,
int b)
color - The color to modifyb - The new blue valuepublic static java.awt.Color setAlpha(java.awt.Color color,
int a)
color - The color to modifya - The new alpha valuepublic static java.awt.Color multiply(java.awt.Color color,
float factor)
color - The color to multiplyfactor - The factor to multiply withpublic static java.awt.Color interpolate(java.awt.Color color1,
java.awt.Color color2,
float progress)
color1 - The first colorcolor2 - The second colorprogress - The progress between the two colorspublic static int distance(java.awt.Color color1,
java.awt.Color color2)
color1 - The first colorcolor2 - The second color