public class Color
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
Color()
Constructs a completely opaque black color object.
|
Color(int color)
Constructs a map color object from a 32-bit encoded integer.
|
Color(long cPtr,
boolean cMemoryOwn) |
Color(short r,
short g,
short b,
short a)
Constructs a map color object from the red, green, blue and alpha components.
Alpha component is interpreted as non-premultiplied transparency value, thus to make half-transparent green, use Color(0, 255, 0, 128). |
Modifier and Type | Method and Description |
---|---|
void |
delete() |
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
short |
getA()
Returns the alpha component of this map color.
|
int |
getARGB()
Encodes this map color into 32-bit integer value (ARGB format).
|
short |
getB()
Returns the blue component of this map color.
|
static long |
getCPtr(Color obj) |
short |
getG()
Returns the green component of this map color.
|
short |
getR()
Returns the red component of this map color.
|
int |
hashCode()
Returns the hash value of this object.
|
java.lang.String |
toString()
Creates a string representation of this map color, useful for logging.
|
public Color(long cPtr, boolean cMemoryOwn)
public Color()
public Color(short r, short g, short b, short a)
r
- The red component. Must be between 0 and 255.g
- The green component. Must be between 0 and 255.b
- The blue component. Must be between 0 and 255.a
- The alpha component. Must be between 0 and 255.public Color(int color)
color
- The color encoded into 32-bit integer as ARGB.public static long getCPtr(Color obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public short getR()
public short getG()
public short getB()
public short getA()
public int getARGB()
public java.lang.String toString()
toString
in class java.lang.Object