edu.washington.biostr.sig.brainj3d.colors
Class Colors

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.colors.Colors

public class Colors
extends Object

This class has static methods to help reuse code that generates Materials and colors and makes it easier to find the appropriate spot to change colors.

Version:
1.0
Author:
Eider Moore

Field Summary
static String DEFAULT_COLOR
          Different applications have different default colors that they want to use.
 
Constructor Summary
Colors()
           
 
Method Summary
static Color getColor(String colorName)
          Get a color from a string.
static javax.media.j3d.Material getMaterial(String colorName)
          Generate a material for a given color.
static ColorScheme makeScheme(String key, double alpha)
          Make a ColorScheme from keywords.
warm fades from red to yellow to white
cold fades from blue to cyan to white
bone doesn't work well yet, but is greyscale that tops out near bone's color
mask creates the mask scheme, which is colorless and masks out other values.
inverted can be added to any name to indicate that 0 is the max value and it logarithmically falls off.
Any color that getColor(String) accepts can also be used for a key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLOR

public static String DEFAULT_COLOR
Different applications have different default colors that they want to use. In the case of the brain version, we want default to be "brain" but other versions may want to set this value to something else.

Constructor Detail

Colors

public Colors()
Method Detail

getMaterial

public static javax.media.j3d.Material getMaterial(String colorName)
Generate a material for a given color. We accept several standard colors (ie red, blue, yellow, magenta, etc) and also the custom color 'brain'. 'default' will give you the default color for this application.

Parameters:
colorName - The color name to use to generate the material.
Returns:
The material for the color.

getColor

public static Color getColor(String colorName)
Get a color from a string. The string can be the name of a standard color or it can be a string of the form: "r,g,b" or "r,g,b,a" where r, g, b and a are integers

Parameters:
colorName - The color name
Returns:
A color

makeScheme

public static ColorScheme makeScheme(String key,
                                     double alpha)
Make a ColorScheme from keywords.
warm fades from red to yellow to white
cold fades from blue to cyan to white
bone doesn't work well yet, but is greyscale that tops out near bone's color
mask creates the mask scheme, which is colorless and masks out other values.
inverted can be added to any name to indicate that 0 is the max value and it logarithmically falls off.
Any color that getColor(String) accepts can also be used for a key.

Parameters:
key - A key from above.
alpha - Transparency
Returns:
A color scheme


Copyright © 2006 University of Washington. All Rights Reserved.