|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.renderer.Color4f
public final class Color4f
A four-element floating point color value.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
float |
a
The components of the color. |
float |
b
The components of the color. |
static Color4f |
BLACK
An opaque black color object. |
static Color4f |
BLUE
An opaque blue color object. |
static Color4f |
CYAN
An opaque cyan color object. |
static Color4f |
DARK_GRAY
An opaque dark gray color object (OpenGL's default ambient material color). |
float |
g
The components of the color. |
static Color4f |
GRAY
An opaque gray color object (OpenGL's default diffuse material color). |
static Color4f |
GREEN
An opaque green color object. |
static Color4f |
MAGENTA
An opaque magenta color object. |
float |
r
The components of the color. |
static Color4f |
RED
An opaque red color object. |
static Color4f |
WHITE
An opaque white color object. |
static Color4f |
YELLOW
An opaque yellor color object. |
| Constructor Summary | |
|---|---|
Color4f()
Creates an opaque white color object. |
|
Color4f(Color color)
Creates a color object from an AWT color. |
|
Color4f(Color4f other)
Copy constructor. |
|
Color4f(float[] values)
Creates a color from an array of values. |
|
Color4f(float r,
float g,
float b,
float a)
Creates a color with the supplied components. |
|
| Method Summary | |
|---|---|
Color4f |
add(Color4f other)
Adds a color to this one. |
Color4f |
add(Color4f other,
Color4f result)
Adds a color to this one, storing the result in the object provided. |
Color4f |
addLocal(Color4f other)
Adds a color in-place to this one. |
Color4f |
clampedAdd(Color4f other)
Adds another color to this one, clamping the elements of the result to one. |
Color4f |
clampedAdd(Color4f other,
Color4f result)
Adds another color to this one, clamping the elements of the result to one, and storing the result in the object provided. |
Color4f |
clampedAddLocal(Color4f other)
Adds another color to this one in-place, clamping the elements of the result to one. |
void |
decodeFromStream(DataInputStream in)
Initializes this object with data read from the specified stream. |
void |
decodeFromString(String string)
Initializes this object with the contents of the specified string. |
void |
encodeToStream(DataOutputStream out)
Encodes this object to the specified stream. |
String |
encodeToString()
Returns a string representation of this object. |
boolean |
equals(Object other)
|
FloatBuffer |
get(FloatBuffer buf)
Places the components of this color object into the specified buffer. |
Color |
getColor()
Returns the AWT color object corresponding to this color. |
Color |
getColor(boolean includeAlpha)
Returns the AWT color object corresponding to this color. |
int |
hashCode()
|
Color4f |
lerp(Color4f other,
float t)
Linearly interpolates between this and the specified other color by the supplied amount. |
Color4f |
lerp(Color4f other,
float t,
Color4f result)
Linearly interpolates between this and the supplied other color by the supplied amount, storing the result in the supplied object. |
Color4f |
lerpLocal(Color4f other,
float t)
Linearly interpolates between this and the specified other color in-place by the supplied amount. |
Color4f |
mult(Color4f other)
Multiplies this color by another. |
Color4f |
mult(Color4f other,
Color4f result)
Multiplies this color by another, storing the result in the object provided. |
Color4f |
mult(float value)
Multiplies this color by the specified value. |
Color4f |
mult(float value,
Color4f result)
Multiplies this color by the specified value, placing the result in the object provided. |
Color4f |
multLocal(Color4f other)
Multiplies this color in-place by another. |
Color4f |
multLocal(float value)
Multiplies this color in-place by the specified value. |
Color4f |
set(Color color)
Copies the components of an AWT color. |
Color4f |
set(Color4f other)
Copies the components of another color. |
Color4f |
set(float[] values)
Copies the elements of an array. |
Color4f |
set(float r,
float g,
float b,
float a)
Sets all the components of this color. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Color4f WHITE
public static final Color4f GRAY
public static final Color4f DARK_GRAY
public static final Color4f BLACK
public static final Color4f RED
public static final Color4f GREEN
public static final Color4f BLUE
public static final Color4f CYAN
public static final Color4f MAGENTA
public static final Color4f YELLOW
public float r
public float g
public float b
public float a
| Constructor Detail |
|---|
public Color4f(float r,
float g,
float b,
float a)
public Color4f(float[] values)
public Color4f(Color4f other)
public Color4f(Color color)
public Color4f()
| Method Detail |
|---|
public Color getColor()
public Color getColor(boolean includeAlpha)
includeAlpha - if true, include the alpha component (otherwise use an opaque
alpha value).public Color4f multLocal(float value)
public Color4f mult(float value)
public Color4f mult(float value,
Color4f result)
public Color4f multLocal(Color4f other)
public Color4f mult(Color4f other)
public Color4f mult(Color4f other,
Color4f result)
public Color4f addLocal(Color4f other)
public Color4f add(Color4f other)
public Color4f add(Color4f other,
Color4f result)
public Color4f clampedAddLocal(Color4f other)
public Color4f clampedAdd(Color4f other)
public Color4f clampedAdd(Color4f other,
Color4f result)
public Color4f lerpLocal(Color4f other,
float t)
public Color4f lerp(Color4f other,
float t)
public Color4f lerp(Color4f other,
float t,
Color4f result)
public Color4f set(Color4f other)
public Color4f set(Color color)
public Color4f set(float[] values)
public Color4f set(float r,
float g,
float b,
float a)
public FloatBuffer get(FloatBuffer buf)
public String encodeToString()
Encodable
encodeToString in interface Encodable
public void decodeFromString(String string)
throws Exception
Encodable
decodeFromString in interface EncodableException
public void encodeToStream(DataOutputStream out)
throws IOException
Encodable
encodeToStream in interface EncodableIOException
public void decodeFromStream(DataInputStream in)
throws IOException
Encodable
decodeFromStream in interface EncodableIOExceptionpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||