public class Colours extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ALPHA_MASK |
static int |
BLUE_MASK |
static int |
BYTE_MASK |
static int |
GREEN_MASK |
static int |
RED_MASK |
static int |
RGB_MASK |
| Constructor and Description |
|---|
Colours() |
| Modifier and Type | Method and Description |
|---|---|
static int |
fromDouble3(double[] col,
int offset) |
static int |
fromFloat3(float[] col,
int offset) |
static int |
fromFloat4(float[] col,
int offset)
Converts an array of floats to an ARGB value
|
static int |
getAlpha(int argb)
Gets the alpha value of an ARGB colour int
|
static int |
getARGB(int rgb,
int alpha) |
static int |
getARGB(int r,
int g,
int b) |
static int |
getARGB(int r,
int g,
int b,
int a) |
static int |
getARGBClamped(double r,
double g,
double b,
double a)
Converts double component values to an ARGB int
|
static int |
getARGBClamped(float r,
float g,
float b,
float a)
Converts float component values to an ARGB int
|
static int |
getARGBClamped(int r,
int g,
int b,
int a) |
static int |
getBlue(int argb)
Gets the blue value of an ARGB colour int
|
static Color |
getColor(int argb) |
static Color |
getColor(int r,
int g,
int b) |
static int |
getGreen(int argb)
Gets the green value of an ARGB colour int
|
static int |
getLuminance(int argb)
Gets the luminance of an ARGB int
|
static int |
getRed(int argb)
Gets the red value of an ARGB colour int
|
static int |
getRGBClamped(double r,
double g,
double b)
Converts double component values to an ARGB int
|
static int |
getRGBClamped(float r,
float g,
float b)
Converts float component values to an ARGB int
|
Color |
getRGBColor(int rgb) |
static int |
randomARGBColour()
Generates a random ARGB colour as a int
|
static void |
toFloat4(float[] col,
int offset,
int argb)
Converts an ARGB value to a array of floats
|
static int |
toGreen(float f) |
static int |
toGreyScale(double d) |
static int |
toGreyScale(float f) |
static int |
toGreyScale(int argb)
Gets the grayscale equivalent of an ARGB int
Sets alpha to 255 (fully opaque)
|
public static int RGB_MASK
public static int RED_MASK
public static int GREEN_MASK
public static int BLUE_MASK
public static int ALPHA_MASK
public static final int BYTE_MASK
public static int getRed(int argb)
argb - public static int getGreen(int argb)
argb - public static int getBlue(int argb)
argb - public static int getAlpha(int argb)
argb - public static int toGreyScale(int argb)
argb - public static int getLuminance(int argb)
argb - public static int getARGBClamped(double r,
double g,
double b,
double a)
r - Red value on 0..1 scaleg - Green value on 0..1 scaleb - Blue value on 0..1 scalea - Alpha value on 0..1 scalepublic static int getARGBClamped(float r,
float g,
float b,
float a)
r - Red value on 0..1 scaleg - Green value on 0..1 scaleb - Blue value on 0..1 scalea - Alpha value on 0..1 scalepublic static int getRGBClamped(float r,
float g,
float b)
r - Red value on 0..1 scaleg - Green value on 0..1 scaleb - Blue value on 0..1 scalepublic static int getRGBClamped(double r,
double g,
double b)
r - Red value on 0..1 scaleg - Green value on 0..1 scaleb - Blue value on 0..1 scalepublic static int getARGBClamped(int r,
int g,
int b,
int a)
public static void toFloat4(float[] col,
int offset,
int argb)
col - offset - argb - public static int fromFloat4(float[] col,
int offset)
col - offset - public static int fromDouble3(double[] col,
int offset)
public static int fromFloat3(float[] col,
int offset)
public static int getARGB(int r,
int g,
int b,
int a)
public static int getARGB(int r,
int g,
int b)
public static int getARGB(int rgb,
int alpha)
public Color getRGBColor(int rgb)
public static Color getColor(int argb)
public static int randomARGBColour()
public static Color getColor(int r, int g, int b)
public static int toGreyScale(float f)
public static int toGreyScale(double d)
public static int toGreen(float f)
Copyright © 2012. All Rights Reserved.