public class LXColor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LXColor.Blend
Color blending modes
|
Modifier and Type | Field and Description |
---|---|
static int |
ALPHA_MASK |
static int |
ALPHA_SHIFT |
static int |
B_MASK |
static int |
BLACK |
static int |
BLUE |
static int |
G_MASK |
static int |
G_SHIFT |
static int |
GREEN |
static int |
R_MASK |
static int |
R_SHIFT |
static int |
RB_MASK |
static int |
RED |
static int |
RGB_MASK |
static int |
WHITE |
Constructor and Description |
---|
LXColor() |
Modifier and Type | Method and Description |
---|---|
static int |
add(int dst,
int src)
Adds the specified colors
|
static int |
add(int dst,
int src,
double alpha)
Adds the specified colors
|
static int |
add(int dst,
int src,
int alpha)
Adds the specified colors
|
static byte |
alpha(int argb) |
static float |
b(int rgb)
Brightness from 0-100
|
static int |
blend(int dst,
int src,
LXColor.Blend blendMode)
Blends the two colors using specified blend based on the alpha channel of c2
|
static byte |
blue(int argb) |
static int |
darkest(int dst,
int src) |
static int |
darkest(int dst,
int src,
double alpha) |
static int |
darkest(int dst,
int src,
int alpha) |
static int |
difference(int dst,
int src) |
static int |
difference(int dst,
int src,
double alpha) |
static int |
difference(int dst,
int src,
int alpha) |
static int |
gray(double brightness)
Produces a grayscale color based upon value from 0-100
|
static int |
gray(float brightness)
Produces a grayscale color based upon value from 0-100
|
static int |
grayn(double brightness)
Produces a grayscale color based upon normalized value from 0-1
|
static int |
grayn(float brightness)
Produces a grayscale color based upon normalized value from 0-1
|
static byte |
green(int argb) |
static float |
h(int rgb)
Hue of a color from 0-360
|
static int |
hsa(float h,
float s,
float a)
Create a color from HSA, where brightness is always full
|
static int |
hsb(double h,
double s,
double b)
Utility to create a color from double values
|
static int |
hsb(float hue,
float saturation,
float brightness)
Create a color from HSB
|
static int |
hsba(double h,
double s,
double b,
double a)
Utility to create a color from double values
|
static int |
hsba(float h,
float s,
float b,
float a)
Create a color from HSB
|
static int |
lerp(int dst,
int src) |
static int |
lerp(int dst,
int src,
double alpha) |
static int |
lerp(int dst,
int src,
float alpha) |
static int |
lerp(int dst,
int src,
int alpha) |
static int |
lightest(int dst,
int src) |
static int |
lightest(int dst,
int src,
double alpha) |
static int |
lightest(int dst,
int src,
int alpha) |
static float |
luminosity(int rgb)
Luminosity from 0-100, using the quick approximated function:
Y = 0.375 R + 0.5 G + 0.125 B
|
static int |
multiply(int dst,
int src) |
static int |
multiply(int dst,
int src,
double alpha) |
static int |
multiply(int dst,
int src,
int alpha) |
static byte |
red(int argb) |
static int |
rgb(int r,
int g,
int b)
Computes an RGB color value
|
static int |
rgba(int r,
int g,
int b,
int a)
Computes an RGB color value
|
static int |
rgbf(float r,
float g,
float b)
Computes an RGB color value from normalized floating point values
|
static float |
s(int rgb)
Saturation from 0-100
|
static int |
screen(int dst,
int src) |
static int |
screen(int dst,
int src,
double alpha) |
static int |
screen(int dst,
int src,
int alpha) |
static int |
subtract(int dst,
int src) |
static int |
subtract(int dst,
int src,
double alpha) |
static int |
subtract(int dst,
int src,
int alpha) |
public static final int BLACK
public static final int WHITE
public static final int RED
public static final int GREEN
public static final int BLUE
public static final int ALPHA_MASK
public static final int R_MASK
public static final int G_MASK
public static final int B_MASK
public static final int RB_MASK
public static final int RGB_MASK
public static final int ALPHA_SHIFT
public static final int R_SHIFT
public static final int G_SHIFT
public static byte alpha(int argb)
public static byte red(int argb)
public static byte green(int argb)
public static byte blue(int argb)
public static float h(int rgb)
rgb
- Color valuepublic static float s(int rgb)
rgb
- Color valuepublic static float b(int rgb)
rgb
- Color valuepublic static float luminosity(int rgb)
rgb
- Color valuepublic static int gray(double brightness)
brightness
- Brightness value from 0-100public static int grayn(double brightness)
brightness
- Brightness value from 0-1public static int gray(float brightness)
brightness
- Brightness value from 0-100public static int grayn(float brightness)
brightness
- Brightness value from 0-1public static final int rgb(int r, int g, int b)
r
- Red 0-255g
- Green 0-255b
- Blue 0-255public static final int rgbf(float r, float g, float b)
r
- Red 0-1g
- Green 0-1b
- Blue 0-1public static final int rgba(int r, int g, int b, int a)
r
- Red 0-255g
- Green 0-255b
- Blue 0-255a
- Alpha 0-255public static final int hsb(double h, double s, double b)
h
- Hues
- Saturationb
- Brightnesspublic static final int hsba(double h, double s, double b, double a)
h
- Hues
- Saturationb
- Brightnessa
- Alphapublic static int hsb(float hue, float saturation, float brightness)
hue
- Hue from 0-360saturation
- Saturation from 0-100brightness
- Brightness from 0-100public static final int hsa(float h, float s, float a)
h
- Hue from 0-360s
- Saturation from 0-100a
- Alpha mask from 0-1public static int hsba(float h, float s, float b, float a)
h
- Hue from 0-360s
- Saturation from 0-100b
- Brightness from 0-100a
- Alpha from 0-1public static int blend(int dst, int src, LXColor.Blend blendMode)
dst
- Background colorsrc
- Overlay color to be blendedblendMode
- Type of blendingpublic static int lerp(int dst, int src)
public static int lerp(int dst, int src, double alpha)
public static int lerp(int dst, int src, float alpha)
public static int lerp(int dst, int src, int alpha)
public static int add(int dst, int src)
dst
- Background colorsrc
- Overlay colorpublic static int add(int dst, int src, double alpha)
dst
- Background colorsrc
- Overlay coloralpha
- Level of blending from 0-1public static int add(int dst, int src, int alpha)
dst
- Background colorsrc
- Overlay coloralpha
- Alpha adjustment (from 0x00 - 0x100)public static int subtract(int dst, int src)
public static int subtract(int dst, int src, double alpha)
public static int subtract(int dst, int src, int alpha)
public static int multiply(int dst, int src)
public static int multiply(int dst, int src, double alpha)
public static int multiply(int dst, int src, int alpha)
public static int screen(int dst, int src)
public static int screen(int dst, int src, double alpha)
public static int screen(int dst, int src, int alpha)
public static int lightest(int dst, int src)
public static int lightest(int dst, int src, double alpha)
public static int lightest(int dst, int src, int alpha)
public static int darkest(int dst, int src)
public static int darkest(int dst, int src, double alpha)
public static int darkest(int dst, int src, int alpha)
public static int difference(int dst, int src)
public static int difference(int dst, int src, double alpha)
public static int difference(int dst, int src, int alpha)
LX library by Mark C. Slee. © 2012-2020