public class

RGBColor

extends Object
implements Color
java.lang.Object
   ↳ casmi.graphics.color.RGBColor

Class Overview

RGB color class.

Summary

Fields
protected double alpha
protected double blue
protected double green
protected double red
Public Constructors
RGBColor(double gray)
Creates a new Color object using Grayscale value.
RGBColor(double gray, double alpha)
Creates a new Color object using Grayscale and alpha values.
RGBColor(double red, double green, double blue)
Creates a new Color object using RGB values.
RGBColor(double red, double green, double blue, double alpha)
Creates a new Color object using RGB and alpha values.
RGBColor(String colorStr)
Creates a new Color object using RGB value in hexadecimal notation (i.e.
RGBColor(ColorSet colorSet)
Creates a new Color object from ColorSet.
RGBColor(ColorSet colorSet, double alpha)
Creates a new Color object from ColorSet and an alpha value.
Public Methods
RGBColor clone()
static Color color(ColorSet colorSet)
Returns the colorset's RGB values.
double getAlpha()
double getBlue()
Color getComplementaryColor()
Returns a Color object that shows a complementary color.
double getGreen()
double getRed()
static RGBColor lerpColor(Color color1, Color color2, double amt)
static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt)
Calculates a color or colors between two color at a specific increment.
void setAlpha(double alpha)
void setBlue(double blue)
void setGray(double gray)
void setGreen(double green)
void setRed(double red)
void setup(GL2 gl)
[Expand]
Inherited Methods
From class java.lang.Object
From interface casmi.graphics.color.Color

Fields

protected double alpha

protected double blue

protected double green

protected double red

Public Constructors

public RGBColor (double gray)

Creates a new Color object using Grayscale value.

Parameters
gray The grayscale value. 0.0 - 1.0.

public RGBColor (double gray, double alpha)

Creates a new Color object using Grayscale and alpha values.

Parameters
gray The grayscale value. 0.0 - 1.0.
alpha The alpha value. 0.0 - 1.0.

public RGBColor (double red, double green, double blue)

Creates a new Color object using RGB values.

Parameters
red The R value. 0.0 - 1.0.
green The G value. 0.0 - 1.0.
blue The B value. 0.0 - 1.0.

public RGBColor (double red, double green, double blue, double alpha)

Creates a new Color object using RGB and alpha values.

Parameters
red The R value. 0.0 - 1.0.
green The G value. 0.0 - 1.0.
blue The B value. 0.0 - 1.0.
alpha The Alpha value. 0.0 - 1.0.

public RGBColor (String colorStr)

Creates a new Color object using RGB value in hexadecimal notation (i.e. "#FFCC44" or 0xFFFFCC00)

public RGBColor (ColorSet colorSet)

Creates a new Color object from ColorSet.

Parameters
colorSet ColorSet.
See Also

public RGBColor (ColorSet colorSet, double alpha)

Creates a new Color object from ColorSet and an alpha value.

Parameters
colorSet ColorSet.
alpha alpha value. 0.0 - 1.0.
See Also

Public Methods

public RGBColor clone ()

public static Color color (ColorSet colorSet)

Returns the colorset's RGB values.

Parameters
colorSet The ColorSet.
Returns
  • The ColorSet's RGB values.

public double getAlpha ()

public double getBlue ()

public Color getComplementaryColor ()

Returns a Color object that shows a complementary color.

Returns
  • a complementary Color object.

public double getGreen ()

public double getRed ()

public static RGBColor lerpColor (Color color1, Color color2, double amt)

public static Color lerpColor (ColorSet colorSet1, ColorSet colorSet2, double amt)

Calculates a color or colors between two color at a specific increment.

Parameters
colorSet1 interpolate from this color
colorSet2 interpolate to this color
amt between 0.0 and 1.0
Returns
  • The calculated color values.

public void setAlpha (double alpha)

public void setBlue (double blue)

public void setGray (double gray)

public void setGreen (double green)

public void setRed (double red)

public void setup (GL2 gl)