public class Color extends Object implements Expression
| Modifier and Type | Class and Description |
|---|---|
class |
Color.HSL
Value class to represent a hue, saturation, lightness triple.
|
| Modifier and Type | Field and Description |
|---|---|
static double |
EPSILON
Used to determine "equality" for floating point numbers
|
| Constructor and Description |
|---|
Color(int hue,
double saturation,
double lightness,
double transparency)
Creates a color based on the given HSL values.
|
Color(int r,
int g,
int b)
Creates a new RGB color based on the given values for red, green and blue.
|
Color(int r,
int g,
int b,
double a)
Creates a new RGB color withl alpha channel (transparency)
|
Color(String hexString)
Creates a new RGB color based on the given hex string
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
eval(Scope scope,
Generator gen)
If possible the expression is evaluated and a simplified expression is returned.
|
Color.HSL |
getHSL()
Computes the HSL value form the stored RGB values.
|
boolean |
isConstant()
Determines if this expression is constant or if it depends on variables.
|
String |
toString() |
public static final double EPSILON
public Color(String hexString)
hexString - a hex representation like #ff00ffpublic Color(int r,
int g,
int b)
r - the value for red 0..255g - the value for green 0..255b - the value for blue 0..255public Color(int r,
int g,
int b,
double a)
r - the value for red 0..255g - the value for green 0..255b - the value for blue 0..255a - the transparency (opacity) 0..1public Color(int hue,
double saturation,
double lightness,
double transparency)
hue - the hue 0..360 degreessaturation - the saturation of the color 0..1lightness - the lightness of the color 0..1transparency - the transparency of the color 0..1public boolean isConstant()
ExpressionisConstant in interface Expressionpublic Expression eval(Scope scope, Generator gen)
Expressioneval in interface Expressionscope - the scope used to resolve variables.gen - the generator used to evaluate functionspublic Color.HSL getHSL()
Copyright © 2016. All rights reserved.