com.metsci.glimpse.support.color
Class GlimpseColor

java.lang.Object
  extended by com.metsci.glimpse.support.color.GlimpseColor

public class GlimpseColor
extends java.lang.Object

A simple color utility class for converting various color wrapper classes/formats to and from the Glimpse/OpenGl cannonical format (a float[] array with four elements for red, green, blue, and alpha in that order). Glimpse uses this format for its color setters partly because OpenGl uses it, and partly in order to reduce reliance on outside color wrappers (of which there are many, and choosing one seems arbitrary).

Author:
ulman

Constructor Summary
GlimpseColor()
           
 
Method Summary
static float[] fromColorAwt(java.awt.Color color)
           
static float[] fromColorHex(java.lang.String color)
           
static float[] fromColorHsb(float hue, float saturation, float brightness)
           
static float[] fromColorRgb(float r, float g, float b)
           
static float[] fromColorRgb(int r, int g, int b)
           
static float[] fromColorRgba(float r, float g, float b, float a)
           
static float[] fromColorRgba(int r, int g, int b, int a)
           
static float[] getBlack()
           
static float[] getBlack(float alpha)
           
static float[] getBlue()
           
static float[] getBlue(float alpha)
           
static float[] getGray()
           
static float[] getGray(float alpha)
           
static float[] getGreen()
           
static float[] getGreen(float alpha)
           
static float[] getRed()
           
static float[] getRed(float alpha)
           
static java.lang.String getString(float[] color)
           
static float[] getWhite()
           
static float[] getWhite(float alpha)
           
static float[] getYellow()
           
static float[] getYellow(float alpha)
           
static void glClearColor(javax.media.opengl.GL gl, float[] color)
           
static void glColor(javax.media.opengl.GL gl, float[] color)
           
static void glColor(javax.media.opengl.GL gl, float[] color, float alphaOverride)
           
static void setColor(com.sun.opengl.util.j2d.TextRenderer renderer, float[] color)
           
static java.awt.Color toColorAwt(float[] color)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlimpseColor

public GlimpseColor()
Method Detail

fromColorRgb

public static float[] fromColorRgb(float r,
                                   float g,
                                   float b)

fromColorRgba

public static float[] fromColorRgba(float r,
                                    float g,
                                    float b,
                                    float a)

fromColorRgb

public static float[] fromColorRgb(int r,
                                   int g,
                                   int b)

fromColorRgba

public static float[] fromColorRgba(int r,
                                    int g,
                                    int b,
                                    int a)

fromColorHsb

public static float[] fromColorHsb(float hue,
                                   float saturation,
                                   float brightness)

fromColorAwt

public static float[] fromColorAwt(java.awt.Color color)

fromColorHex

public static float[] fromColorHex(java.lang.String color)
                            throws java.text.ParseException
Throws:
java.text.ParseException

toColorAwt

public static java.awt.Color toColorAwt(float[] color)

glClearColor

public static void glClearColor(javax.media.opengl.GL gl,
                                float[] color)

setColor

public static void setColor(com.sun.opengl.util.j2d.TextRenderer renderer,
                            float[] color)

glColor

public static void glColor(javax.media.opengl.GL gl,
                           float[] color)

glColor

public static void glColor(javax.media.opengl.GL gl,
                           float[] color,
                           float alphaOverride)

getString

public static java.lang.String getString(float[] color)

getRed

public static float[] getRed()

getRed

public static float[] getRed(float alpha)

getGreen

public static float[] getGreen()

getGreen

public static float[] getGreen(float alpha)

getYellow

public static float[] getYellow()

getYellow

public static float[] getYellow(float alpha)

getBlue

public static float[] getBlue()

getBlue

public static float[] getBlue(float alpha)

getWhite

public static float[] getWhite()

getWhite

public static float[] getWhite(float alpha)

getBlack

public static float[] getBlack()

getBlack

public static float[] getBlack(float alpha)

getGray

public static float[] getGray()

getGray

public static float[] getGray(float alpha)


Copyright © 2012 Metron, Inc.. All Rights Reserved.