|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscenic.ScenicColor
public class ScenicColor
This class defines a color that consists of red, green, blue and alpha components. Each component is a single precision floating point number which ranges from 0 to 1. By default, alpha component 1 means fully opaque and 0 fully transparent. Scenic uses premultiplied alpha ie. the red, green and blue channels are not multiplied with the alpha value when the color is displayed. The range of the color values is not limited. Currently, however, values outside 0 - 1 are not supported by the renderer.
| Field Summary | |
|---|---|
float |
alpha
|
float |
blue
|
float |
green
|
float |
red
|
| Constructor Summary | |
|---|---|
ScenicColor()
Default constructor. |
|
ScenicColor(java.awt.Color color)
|
|
ScenicColor(float luminance)
Creates a grey with the given luminance. |
|
ScenicColor(float red,
float green,
float blue)
Creates a color with the given red, green and blue values. |
|
ScenicColor(float red,
float green,
float blue,
float alpha)
Creates a color with the given red, green, blue and alpha values. |
|
| Method Summary | |
|---|---|
static ScenicColor |
byteColor(int red,
int green,
int blue)
Creates a color using 8-bit component values in the range 0-255. |
static ScenicColor |
byteColor(int red,
int green,
int blue,
int alpha)
Creates a color using 8-bit component values in the range 0-255. |
static float |
clamp(float a)
Clamps the given value to the range [0, 1]. |
static ScenicColor |
interpolate(ScenicColor a,
ScenicColor b,
float v)
Interpolates between the given colors. |
ScenicColor |
multiply(float m)
Returns a color multiplied with the given value. |
ScenicColor |
multiplyByAlpha()
Returns a color multiplied by the alpha channel. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public float red
public float green
public float blue
public float alpha
| Constructor Detail |
|---|
public ScenicColor()
public ScenicColor(float luminance)
luminance - the luminance value.
public ScenicColor(float red,
float green,
float blue)
public ScenicColor(float red,
float green,
float blue,
float alpha)
public ScenicColor(java.awt.Color color)
| Method Detail |
|---|
public static ScenicColor byteColor(int red,
int green,
int blue)
public static ScenicColor byteColor(int red,
int green,
int blue,
int alpha)
public static float clamp(float a)
a - the value to be clamped.
public ScenicColor multiply(float m)
m - the value used for multiplication.
public ScenicColor multiplyByAlpha()
public java.lang.String toString()
toString in class java.lang.Object
public static ScenicColor interpolate(ScenicColor a,
ScenicColor b,
float v)
a - the first color to be interpolated.b - the second color to be interpolated.v - selects the position between the colors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||