public class ColorScale
extends java.lang.Object
The Class ColorScale creates a color scale based on the 3 overlapping Gaussian functions representing bands of red, green and blue.
Constructor and Description |
---|
ColorScale(double x0R,
double x0G,
double x0B,
double aR,
double aG,
double aB)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getAB()
Gets the width of the Blue color band.
|
double |
getAG()
Gets the width of the Green color band.
|
double |
getAR()
Gets the width of the Red color band.
|
org.eclipse.swt.graphics.Color |
getColor(double x)
Returns a color for the provided value between 0 and 1.
|
double |
getX0B()
Gets the position of the Blue color band.
|
double |
getX0G()
Gets the position of the Green color band.
|
double |
getX0R()
Gets the position of the Red color band.
|
public ColorScale(double x0R, double x0G, double x0B, double aR, double aG, double aB)
The Constructor.
x0R
- the position of the Red color bandx0G
- the position of the Green color bandx0B
- the position of the Blue color bandaR
- the width of the Red color bandaG
- the width of the Green color bandaB
- the width of the Blue color bandpublic org.eclipse.swt.graphics.Color getColor(double x)
Returns a color for the provided value between 0 and 1. If the provided value is less than 0, then it will be set to 0. If the value is greater than 1, then it will be set to 1.
x
- a value between 0 and 1public double getX0R()
Gets the position of the Red color band.
public double getX0G()
Gets the position of the Green color band.
public double getX0B()
Gets the position of the Blue color band.
public double getAR()
Gets the width of the Red color band.
public double getAG()
Gets the width of the Green color band.
public double getAB()
Gets the width of the Blue color band.