public class GradientHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
blendColors(int color1,
int color2,
float ratio)
Computes the color resulting by blending two colors with a ratio.
|
static int[] |
createGradient(Display display,
int startColor,
int endColor)
Creates a gradient between two colors on a display.
|
public static int blendColors(int color1,
int color2,
float ratio)
color1 - the first color.color2 - the second color.ratio - the ratio of the second color which means the ratio of the first color is 1 - ratio. This
value is clamped between 0 and 1.public static int[] createGradient(Display display, int startColor, int endColor)
The result is an array of colors where:
display - the display where the gradient will be used.startColor - the start color of the gradient.endColor - the end color of the gradient.Display.getDisplayColor(int)