Class RGBTriplet

java.lang.Object
  |
  +--RGBTriplet

public class RGBTriplet
extends Object

Stores RGB Triplet float values.

Author:
A Sasmito Adibowo - 12990000029

Field Summary
 float B
          The Blue color value.
 float G
          The Green color value.
 float R
          The Red color value.
 
Constructor Summary
RGBTriplet()
          Constructs the RGB triplet with (R,G,B) values of (1,1,1).
RGBTriplet(Color col)
          Constructs the RGB Triplet from the specified Color object.
RGBTriplet(float r, float g, float b)
          Constructs the RGB triplet with the specified (R,G,B) values.
 
Method Summary
 Color toColor()
          Creates a new Color object from this RGBTriplet.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

R

public float R
The Red color value.

G

public float G
The Green color value.

B

public float B
The Blue color value.
Constructor Detail

RGBTriplet

public RGBTriplet(Color col)
Constructs the RGB Triplet from the specified Color object.

RGBTriplet

public RGBTriplet()
Constructs the RGB triplet with (R,G,B) values of (1,1,1).

RGBTriplet

public RGBTriplet(float r,
                  float g,
                  float b)
Constructs the RGB triplet with the specified (R,G,B) values.
Method Detail

toColor

public Color toColor()
Creates a new Color object from this RGBTriplet.
Returns:
the new Color object.