public final class Color extends Paint
Paint.Type
Modifier and Type | Field and Description |
---|---|
private float |
a |
private int |
argb |
private float |
b |
static Color |
BLACK |
static Color |
BLUE |
private float |
g |
static Color |
GREEN |
private float |
r |
static Color |
RED |
static Color |
TRANSPARENT |
static Color |
WHITE |
Constructor and Description |
---|
Color(float r,
float g,
float b,
float a)
Constructs a new
Color instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
float |
getAlpha()
Returns the alpha component of this
Color . |
float |
getBlue()
Returns the blue component of this
Color in
non-premultiplied form. |
float |
getBluePremult()
Returns the blue component of this
Color in
premultiplied form. |
float |
getGreen()
Returns the green component of this
Color in
non-premultiplied form. |
float |
getGreenPremult()
Returns the green component of this
Color in
premultiplied form. |
int |
getIntArgbPre()
Returns this color value (in premultiplied form) packed into an integer
in ARGB order.
|
float |
getRed()
Returns the red component of this
Color in
non-premultiplied form. |
float |
getRedPremult()
Returns the red component of this
Color in
premultiplied form. |
int |
hashCode() |
boolean |
isOpaque() |
void |
putBgraPreBytes(java.nio.ByteBuffer buf)
Stores the color components (in premultiplied form) of this
Color object into the given ByteBuffer in BGRA order. |
void |
putRgbaPreBytes(byte[] arr,
int offset)
Stores the color components (in premultiplied form) of this
Color object into a byte array in RGBA order. |
java.lang.String |
toString() |
getType, isMutable, isProportional
public static final Color WHITE
public static final Color BLACK
public static final Color RED
public static final Color GREEN
public static final Color BLUE
public static final Color TRANSPARENT
private final int argb
private final float r
private final float g
private final float b
private final float a
public Color(float r, float g, float b, float a)
Color
instance.
The color components should be provided in non-premultiplied format.public int getIntArgbPre()
public void putRgbaPreBytes(byte[] arr, int offset)
Color
object into a byte array in RGBA order.public void putBgraPreBytes(java.nio.ByteBuffer buf)
Color
object into the given ByteBuffer in BGRA order.public float getRed()
Color
in
non-premultiplied form.public float getRedPremult()
Color
in
premultiplied form.public float getGreen()
Color
in
non-premultiplied form.public float getGreenPremult()
Color
in
premultiplied form.public float getBlue()
Color
in
non-premultiplied form.public float getBluePremult()
Color
in
premultiplied form.public float getAlpha()
Color
.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object