public final class Colors extends Object
Modifier and Type | Method and Description |
---|---|
static Color |
between(Color a,
Color b,
double value)
Creates a color which "lies between" the colors
a
and b |
static Color |
between(Color a,
double weightA,
Color b,
double weightB,
Color c,
double weightC)
Creates a color that "lies between" the colors
a , b and
c . |
static Color |
brighter(Color color)
Helper methods calling
Color.brighter() . |
static Color |
brighter(Color c,
double value)
Increases the brightness of a color.
|
static Color |
darker(Color color)
Helper methods calling
Color.darker() . |
static Color |
darker(Color c,
double value)
Decreases the brightness of a color.
|
static Color |
deltaBrightness(Color c,
double delta)
Converts
c into HSB and adds delta to the brightness. |
static Color |
diffMirror(Color color,
double factor) |
static Color |
fuller(Color color,
double factor) |
static Color |
middle(Color a,
Color b) |
static Color |
undiffMirror(Color color,
double factor) |
public static Color darker(Color c, double value)
c
- the color which will be made darkervalue
- how much darker the color should be, 1 means black, 0
means c
is returnedc
public static Color brighter(Color c, double value)
c
- the color which will be made brightervalue
- how much brighter the color should be, 1 means
white, 0 means c
is returnedc
public static Color deltaBrightness(Color c, double delta)
c
into HSB and adds delta
to the brightness.c
- the color to convertdelta
- the delta in brightnesspublic static Color between(Color a, Color b, double value)
a
and b
a
- the first colorb
- the second colorvalue
- a value between 0 and 1, 0 means a
is returned,
1 means b
is returneda
and b
public static Color between(Color a, double weightA, Color b, double weightB, Color c, double weightC)
a
, b
and
c
. Each color has a weight, and as higher the weight as more of that color
is inside the created color.a
- the first color to incorporateweightA
- how much of a
goes into the resulting colorb
- the second color to incorporateweightB
- how much of b
goes into the resulting colorc
- the third color to incorporateweightC
- how much of c
goes into the resulting color(a * weightA + b * weightB + c * weightC) / (weightA + weightB + weightC)
public static Color darker(Color color)
Color.darker()
.color
- some color to modify, can be null
null
public static Color brighter(Color color)
Color.brighter()
.color
- some color to modify, can be null
null