java.lang.Object | |
↳ | com.carto.graphics.Color |
A color represented in RGBA space, alpha is expected to be non-premultiplied.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Color()
Constructs a completely opaque black color object.
| |||||||||||
Color(short r, short g, short b, short a)
Constructs a map color object from the red, green, blue and alpha components.
| |||||||||||
Color(int color)
Constructs a map color object from a 32-bit encoded integer.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
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.
| ||||||||||
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.
| ||||||||||
String |
toString()
Creates a string representation of this map color, useful for logging.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a completely opaque black color object.
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).
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. |
Constructs a map color object from a 32-bit encoded integer. The format is expected to be ARGB.
color | The color encoded into 32-bit integer as ARGB. |
---|
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns the alpha component of this map color.
Encodes this map color into 32-bit integer value (ARGB format).
Returns the blue component of this map color.
Returns the green component of this map color.
Returns the red component of this map color.
Returns the hash value of this object.
Creates a string representation of this map color, useful for logging.