public class ColorUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
Black |
static int |
Blue |
static int |
Brown |
static int |
Chartreuse |
static int |
CornflowerBlue |
static int |
Cyan |
static int |
DarkBlue |
static int |
DarkGreen |
static int |
DarkRed |
static int |
Gold |
static int |
Green |
static int |
Grey |
static int |
Lavender |
static int |
LightBlue |
static int |
LightSteelBlue |
static int |
Lime |
static int |
LimeGreen |
static int |
Magenta |
static int |
Maroon |
static int |
Navy |
static int |
Olive |
static int |
Orange |
static int |
Purple |
static int |
Red |
static int |
SteelBlue |
static int |
Teal |
static int |
Transparent |
static int |
Wheat |
static int |
White |
static int |
Yellow |
Constructor and Description |
---|
ColorUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
alpha(int color)
Gets alpha value from color
|
static int |
argb(int color,
float opacity)
Applies specified opacity value to provided color
|
static int |
argb(int alpha,
int red,
int green,
int blue)
Creates color value from separated ARGB values
|
static int |
argb(int alpha,
int red,
int green,
int blue,
float opacity)
Creates color value from separated ARGB values with specified opacity
|
static int |
blue(int color)
Gets blue value from color
|
static int |
getAlphaFromOpacity(float opacity)
Gets the alpha value based on provided opacity value
|
static int |
getInvertedColor(int color)
Gets the inverted color for provided color
|
static int |
green(int color)
Gets green value from color
|
static int |
red(int color)
Gets red value from color
|
static int |
rgb(int red,
int green,
int blue)
Creates color value from separated RGB values
|
public static final int Transparent
public static final int White
public static final int Black
public static final int Red
public static final int Green
public static final int Blue
public static final int Cyan
public static final int Yellow
public static final int Magenta
public static final int Lime
public static final int Maroon
public static final int Grey
public static final int Purple
public static final int Olive
public static final int Teal
public static final int Navy
public static final int DarkBlue
public static final int Orange
public static final int SteelBlue
public static final int LightSteelBlue
public static final int Lavender
public static final int Gold
public static final int DarkGreen
public static final int DarkRed
public static final int LimeGreen
public static final int CornflowerBlue
public static final int Chartreuse
public static final int LightBlue
public static final int Wheat
public static final int Brown
public static int alpha(int color)
color
- The color valuepublic static int red(int color)
color
- The color valuepublic static int green(int color)
color
- The color valuepublic static int blue(int color)
color
- The color valuepublic static int rgb(int red, int green, int blue)
red
- The red valuegreen
- The green valueblue
- The blue valuepublic static int argb(int alpha, int red, int green, int blue)
alpha
- The alpha valuered
- The red valuegreen
- The green valueblue
- The blue valuepublic static int argb(int alpha, int red, int green, int blue, float opacity)
alpha
- The alpha valuered
- The red valuegreen
- The green valueblue
- The blue valueopacity
- The opacity valuepublic static int argb(int color, float opacity)
color
- The input coloropacity
- The opacity valuepublic static int getAlphaFromOpacity(float opacity)
opacity
- The opacity valuepublic static int getInvertedColor(int color)
color
- The input color