public class Color extends Object
Stores an RGBA color as 4 scalar parameters and provides utility methods to deal with colors.
Modifier and Type | Field and Description |
---|---|
protected ScalarParameter |
alpha |
protected ScalarParameter |
blue |
protected ScalarParameter |
green |
protected ScalarParameter |
red |
Constructor and Description |
---|
Color() |
Color(float redVal,
float greenVal,
float blueVal,
float alphaVal)
Constructor using float values between 0.0 and 1.0
|
Color(int redVal,
int greenVal,
int blueVal,
int alphaVal)
Constructor using integer component values between 0 and 255
|
Color(String hexValue)
Constructor using an hexadecimal RGB value
|
Modifier and Type | Method and Description |
---|---|
ScalarParameter |
getAlpha() |
float |
getAlphaValue() |
ScalarParameter |
getBlue() |
float |
getBlueValue() |
ScalarParameter |
getGreen() |
float |
getGreenValue() |
ScalarParameter |
getRed() |
float |
getRedValue() |
boolean |
isConstant() |
void |
setAlpha(ScalarParameter alpha) |
void |
setAlphaValue(float alphaVal) |
void |
setBlue(ScalarParameter blue) |
void |
setBlueValue(float blueVal) |
void |
setFromHexValue(String hexValue) |
void |
setGreen(ScalarParameter green) |
void |
setGreenValue(float greenVal) |
void |
setRed(ScalarParameter red) |
void |
setRedValue(float redVal) |
static String |
toHexString(float r,
float g,
float b,
boolean bgr) |
static String |
toHexString(float r,
float g,
float b,
float a,
boolean abgr) |
protected ScalarParameter red
protected ScalarParameter green
protected ScalarParameter blue
protected ScalarParameter alpha
public Color()
public Color(float redVal, float greenVal, float blueVal, float alphaVal)
red
- green
- blue
- alpha
- public Color(int redVal, int greenVal, int blueVal, int alphaVal)
red
- green
- blue
- alpha
- public Color(String hexValue)
hexValue
- public static String toHexString(float r, float g, float b, boolean bgr)
public static String toHexString(float r, float g, float b, float a, boolean abgr)
public boolean isConstant()
public void setFromHexValue(String hexValue)
public ScalarParameter getAlpha()
public void setAlpha(ScalarParameter alpha)
public ScalarParameter getBlue()
public void setBlue(ScalarParameter blue)
public ScalarParameter getGreen()
public void setGreen(ScalarParameter green)
public ScalarParameter getRed()
public void setRed(ScalarParameter red)
public float getAlphaValue()
public void setAlphaValue(float alphaVal)
public float getBlueValue()
public void setBlueValue(float blueVal)
public float getGreenValue()
public void setGreenValue(float greenVal)
public float getRedValue()
public void setRedValue(float redVal)
Copyright © 2016 Sensia Software LLC. All rights reserved.