public class ColorRGBA extends Message
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_A
The name of the a field for the message.
|
static String |
FIELD_B
The name of the b field for the message.
|
static String |
FIELD_G
The name of the g field for the message.
|
static String |
FIELD_R
The name of the r field for the message.
|
static String |
TYPE
The message type.
|
EMPTY_MESSAGEEMPTY_JSON| Constructor and Description |
|---|
ColorRGBA()
Create a new ColorRGBA with all 0s for colors and an alpha value of 1.
|
ColorRGBA(float r,
float g,
float b)
Create a new ColorRGBA with the given color values (alpha will be 1).
|
ColorRGBA(float r,
float g,
float b,
float a)
Create a new ColorRGBA with the given color values.
|
| Modifier and Type | Method and Description |
|---|---|
ColorRGBA |
clone()
Create a clone of this ColorRGBA.
|
static ColorRGBA |
fromColor(Color c)
Create a new ColorRGBA based on the color information in the Java Color
object.
|
static ColorRGBA |
fromJsonObject(javax.json.JsonObject jsonObject)
Create a new ColorRGBA based on the given JSON object.
|
static ColorRGBA |
fromJsonString(String jsonString)
Create a new ColorRGBA based on the given JSON string.
|
static ColorRGBA |
fromMessage(Message m)
Create a new ColorRGBA based on the given Message.
|
float |
getA()
Get the a value of this color.
|
float |
getB()
Get the b value of this color.
|
float |
getG()
Get the g value of this color.
|
float |
getR()
Get the r value of this color.
|
Color |
toColor()
Convert this color message to a new Java Color object.
|
getMessageType, setMessageTypeequals, hashCode, toJsonObject, toStringpublic static final String FIELD_R
public static final String FIELD_G
public static final String FIELD_B
public static final String FIELD_A
public static final String TYPE
public ColorRGBA()
public ColorRGBA(float r,
float g,
float b)
r - The r value of the color.g - The g value of the color.b - The b value of the color.public ColorRGBA(float r,
float g,
float b,
float a)
r - The r value of the color.g - The g value of the color.b - The b value of the color.a - The a value of the color.public float getR()
public float getG()
public float getB()
public float getA()
public Color toColor()
public static ColorRGBA fromColor(Color c)
c - The Java Color object containing the color information.public static ColorRGBA fromJsonString(String jsonString)
jsonString - The JSON string to parse.public static ColorRGBA fromMessage(Message m)
m - The Message to parse.public static ColorRGBA fromJsonObject(javax.json.JsonObject jsonObject)
jsonObject - The JSON object to parse.Copyright © 2014. All rights reserved.