edu.iastate.metnet.birdseyeview
Class GeneColor

java.lang.Object
  extended by edu.iastate.metnet.birdseyeview.GeneColor

public class GeneColor
extends java.lang.Object

The GeneColor Class determines the color of a gene panel based on the experimental variance of the gene product. It only has static methods. Remember that the variance is given as a percentage which could be positive or negative. The HSVtoRGB and RGBtoHSV methods work reasonably well. HSVtoRGB is sometimes off by 1 w/respect to blue, and RGBtoHSV sometimes is off by 1 w/respect to the hue. Regardless, none of the methods will return an invalid values.

Author:
Matt Studham Created Jan 24, 2005

Constructor Summary
GeneColor()
           
 
Method Summary
static java.awt.Color determineColor(double variance)
          This method determines the color of a gene panel based on the given variance.
static java.awt.Color directdetermineColor(double variance)
          This method determines the color of a gene panel based on the given variance.
static java.util.ArrayList HSVtoRGB(double hue, double saturation, double brightness)
          This method determines the RGB values of the given color in HSV values.
static void main(java.lang.String[] args)
          This method tests the GeneColor class.
static java.util.ArrayList RGBtoHSV(int red, int green, int blue)
          This method determines the HSV values of the given color in RGB values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneColor

public GeneColor()
Method Detail

determineColor

public static java.awt.Color determineColor(double variance)
This method determines the color of a gene panel based on the given variance.

Parameters:
variance - Experimental variance, as a percentage
Returns:
Color

directdetermineColor

public static java.awt.Color directdetermineColor(double variance)
This method determines the color of a gene panel based on the given variance.

Parameters:
variance - Experimental variance, as a percentage
Returns:
Color

RGBtoHSV

public static java.util.ArrayList RGBtoHSV(int red,
                                           int green,
                                           int blue)
This method determines the HSV values of the given color in RGB values. The RGB values are integers from 0 to 255 and the HSV values are doubles from 0.0 to 1.0.

Parameters:
red -
green -
blue -
Returns:
ArrayList List of 3 Double values ([0]=hue, [1]=saturation, [2]=brightness)

HSVtoRGB

public static java.util.ArrayList HSVtoRGB(double hue,
                                           double saturation,
                                           double brightness)
This method determines the RGB values of the given color in HSV values. The RGB values are integers from 0 to 255 and the HSV values are doubles from 0.0 to 1.0.

Parameters:
hue -
saturation -
brightness -
Returns:
ArrayList List of 3 Integer objects ([0]=red, [1]=blue, [2]=green)

main

public static void main(java.lang.String[] args)
This method tests the GeneColor class.

Parameters:
args -