org.vizzini.ui
Class WheelColor

java.lang.Object
  extended by java.awt.Color
      extended by org.vizzini.ui.WheelColor
All Implemented Interfaces:
Paint, Transparency, Serializable, Comparable

public class WheelColor
extends Color
implements Comparable

Provides color wheel colors, grayscale colors, and utility methods.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
static WheelColor ALUMINUM
          Aluminum color constant.
static WheelColor BLACK
          Black color constant.
static WheelColor BLUE
          Blue color constant.
static WheelColor BLUE_GREEN
          Cyan (blue-green) color constant.
static WheelColor BLUE_PURPLE
          Blue-purple color constant.
static WheelColor BLUEBERRY
          Blueberry (blue-purple) color constant.
static WheelColor BROWN
          Brown color constant.
static WheelColor BURNT_ORANGE
          Burnt-orange (red-orange) color constant.
static WheelColor CANTALOUPE
          Cantaloupe (yellow-orange) color constant.
static WheelColor CYAN
          Cyan (blue-green) color constant.
static String GRAYSCALE
          Gray scale color designator.
static WheelColor GREEN
          Green color constant.
static WheelColor INDIGO
          Indigo color constant.
static WheelColor IRON
          Iron color constant.
static WheelColor LEAD
          Lead color constant.
static WheelColor LIME
          Lime (yellow-green) color constant.
static WheelColor MAGENTA
          Magenta color constant.
static WheelColor MAGNESIUM
          Magnesium color constant.
static WheelColor MAROON
          Maroon color constant.
static WheelColor MERCURY
          Mercury color constant.
static WheelColor NAVY
          Navy color constant.
static WheelColor NICKEL
          Nickel (gray) color constant.
static WheelColor OLIVE
          Olive color constant.
static WheelColor ORANGE
          Orange color constant.
static String PRIMARY
          Primary color designator.
static WheelColor PURPLE
          Purple color constant.
static WheelColor RASPBERRY
          Raspberry (red-purple) color constant.
static WheelColor RED
          Red color constant.
static WheelColor RED_ORANGE
          Red-orange color constant.
static WheelColor RED_PURPLE
          Red-purple color constant.
static String SECONDARY
          Secondary color designator.
static WheelColor SILVER
          Silver (light gray) color constant.
static WheelColor STEEL
          Steel color constant.
static WheelColor TEAL
          Teal color constant.
static String TERTIARY
          Tertiary color designator.
static WheelColor TIN
          Tin (gray) color constant.
static WheelColor TRANSPARENT
          Transparent color constant.
static WheelColor TUNGSTEN
          Tungsten color constant.
static WheelColor VIOLET
          Violet color constant.
static WheelColor WHITE
          White color constant.
static WheelColor YELLOW
          Yellow color constant.
static WheelColor YELLOW_GREEN
          Yellow-green color constant.
static WheelColor YELLOW_ORANGE
          Yellow-orange color constant.
 
Fields inherited from class java.awt.Color
black, blue, cyan, DARK_GRAY, darkGray, gray, GRAY, green, LIGHT_GRAY, lightGray, magenta, orange, pink, PINK, red, white, yellow
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
WheelColor(String name, Color color, String type)
          Construct this object with the given parameters.
WheelColor(String name, Color color, String type, String alternateName)
          Construct this object with the given parameters.
WheelColor(String name, int red, int green, int blue)
          Construct this object with the given parameters.
WheelColor(String name, int red, int green, int blue, int alpha, String type, String alternateName)
          Construct this object with the given parameters.
WheelColor(String name, int red, int green, int blue, String type)
          Construct this object with the given parameters.
WheelColor(String name, int red, int green, int blue, String type, String alternateName)
          Construct this object with the given parameters.
 
Method Summary
static Iterator colorIterator()
          Return an iterator over all the colors known to this class.
 int compareTo(Object obj)
          Return -1,0, or 1 if this is less than, equal to, or greater than the given object.
static WheelColor get(String name)
          Return the color with the given name.
 String getAlternateName()
          Return the alternate name.
 WheelColor[] getAnalogous()
          Return the analogous colors.
static WheelColor[] getColorSpectrumColors()
          Return an array of colors representing the color spectrum.
static WheelColor[] getColorWheelColors()
          Return an array of colors representing the color wheel, starting with yellow.
 WheelColor getComplement()
          Return the complementary color.
static WheelColor[] getGrayscaleColors()
          Return an array of grayscale colors, starting with black.
 String getName()
          Return the name.
static Map getPrimaryColors()
          Return an array of primary colors.
static Map getSecondaryColors()
          Return an array of secondary colors.
static Map getTertiaryColors()
          Return an array of tertiary colors.
 String getType()
          Return the type.
 void setAlternateName(String alternateName)
          Set the alternate color name.
 void setAnalogous(WheelColor color0, WheelColor color1)
          Set the analogous colors.
 void setComplement(WheelColor color)
          Set the complementary color.
 void setName(String name)
          Set the color name.
 void setType(String type)
          Set the color type.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIMARY

public static final String PRIMARY
Primary color designator.

See Also:
Constant Field Values

SECONDARY

public static final String SECONDARY
Secondary color designator.

See Also:
Constant Field Values

TERTIARY

public static final String TERTIARY
Tertiary color designator.

See Also:
Constant Field Values

GRAYSCALE

public static final String GRAYSCALE
Gray scale color designator.

See Also:
Constant Field Values

RED

public static final WheelColor RED
Red color constant.


YELLOW

public static final WheelColor YELLOW
Yellow color constant.


BLUE

public static final WheelColor BLUE
Blue color constant.


GREEN

public static final WheelColor GREEN
Green color constant.


ORANGE

public static final WheelColor ORANGE
Orange color constant.


PURPLE

public static final WheelColor PURPLE
Purple color constant.


YELLOW_ORANGE

public static final WheelColor YELLOW_ORANGE
Yellow-orange color constant.


RED_ORANGE

public static final WheelColor RED_ORANGE
Red-orange color constant.


RED_PURPLE

public static final WheelColor RED_PURPLE
Red-purple color constant.


BLUE_PURPLE

public static final WheelColor BLUE_PURPLE
Blue-purple color constant.


BLUE_GREEN

public static final WheelColor BLUE_GREEN
Cyan (blue-green) color constant.


YELLOW_GREEN

public static final WheelColor YELLOW_GREEN
Yellow-green color constant.


CANTALOUPE

public static final WheelColor CANTALOUPE
Cantaloupe (yellow-orange) color constant.


BURNT_ORANGE

public static final WheelColor BURNT_ORANGE
Burnt-orange (red-orange) color constant.


RASPBERRY

public static final WheelColor RASPBERRY
Raspberry (red-purple) color constant.


BLUEBERRY

public static final WheelColor BLUEBERRY
Blueberry (blue-purple) color constant.


CYAN

public static final WheelColor CYAN
Cyan (blue-green) color constant.


LIME

public static final WheelColor LIME
Lime (yellow-green) color constant.


BROWN

public static final WheelColor BROWN
Brown color constant.


MAGENTA

public static final WheelColor MAGENTA
Magenta color constant.


MAROON

public static final WheelColor MAROON
Maroon color constant.


OLIVE

public static final WheelColor OLIVE
Olive color constant.


NAVY

public static final WheelColor NAVY
Navy color constant.


TEAL

public static final WheelColor TEAL
Teal color constant.


INDIGO

public static final WheelColor INDIGO
Indigo color constant.


VIOLET

public static final WheelColor VIOLET
Violet color constant.


BLACK

public static final WheelColor BLACK
Black color constant.


LEAD

public static final WheelColor LEAD
Lead color constant.


TUNGSTEN

public static final WheelColor TUNGSTEN
Tungsten color constant.


IRON

public static final WheelColor IRON
Iron color constant.


STEEL

public static final WheelColor STEEL
Steel color constant.


TIN

public static final WheelColor TIN
Tin (gray) color constant.


NICKEL

public static final WheelColor NICKEL
Nickel (gray) color constant.


ALUMINUM

public static final WheelColor ALUMINUM
Aluminum color constant.


MAGNESIUM

public static final WheelColor MAGNESIUM
Magnesium color constant.


SILVER

public static final WheelColor SILVER
Silver (light gray) color constant.


MERCURY

public static final WheelColor MERCURY
Mercury color constant.


WHITE

public static final WheelColor WHITE
White color constant.


TRANSPARENT

public static final WheelColor TRANSPARENT
Transparent color constant.

Constructor Detail

WheelColor

public WheelColor(String name,
                  Color color,
                  String type)
Construct this object with the given parameters.

Since:
v0.1

WheelColor

public WheelColor(String name,
                  int red,
                  int green,
                  int blue)
Construct this object with the given parameters.

Since:
v0.1

WheelColor

public WheelColor(String name,
                  Color color,
                  String type,
                  String alternateName)
Construct this object with the given parameters.

Since:
v0.1

WheelColor

public WheelColor(String name,
                  int red,
                  int green,
                  int blue,
                  String type)
Construct this object with the given parameters.

Since:
v0.1

WheelColor

public WheelColor(String name,
                  int red,
                  int green,
                  int blue,
                  String type,
                  String alternateName)
Construct this object with the given parameters.

Since:
v0.1

WheelColor

public WheelColor(String name,
                  int red,
                  int green,
                  int blue,
                  int alpha,
                  String type,
                  String alternateName)
Construct this object with the given parameters.

Since:
v0.2
Method Detail

colorIterator

public static Iterator colorIterator()
Return an iterator over all the colors known to this class.

Since:
v0.1

get

public static WheelColor get(String name)
Return the color with the given name.

Since:
v0.1

getColorSpectrumColors

public static WheelColor[] getColorSpectrumColors()
Return an array of colors representing the color spectrum.

Since:
v0.3

getColorWheelColors

public static WheelColor[] getColorWheelColors()
Return an array of colors representing the color wheel, starting with yellow.

Since:
v0.1

getGrayscaleColors

public static WheelColor[] getGrayscaleColors()
Return an array of grayscale colors, starting with black.

Since:
v0.1

getPrimaryColors

public static Map getPrimaryColors()
Return an array of primary colors.

Since:
v0.1

getSecondaryColors

public static Map getSecondaryColors()
Return an array of secondary colors.

Since:
v0.1

getTertiaryColors

public static Map getTertiaryColors()
Return an array of tertiary colors.

Since:
v0.1

compareTo

public int compareTo(Object obj)
Return -1,0, or 1 if this is less than, equal to, or greater than the given object.

Specified by:
compareTo in interface Comparable
Since:
v0.1

getAlternateName

public String getAlternateName()
Return the alternate name.

Since:
v0.1

getAnalogous

public WheelColor[] getAnalogous()
Return the analogous colors.

Since:
v0.1

getComplement

public WheelColor getComplement()
Return the complementary color.

Since:
v0.1

getName

public String getName()
Return the name.

Since:
v0.1

getType

public String getType()
Return the type.

Since:
v0.1

setAlternateName

public void setAlternateName(String alternateName)
Set the alternate color name.

Since:
v0.1

setAnalogous

public void setAnalogous(WheelColor color0,
                         WheelColor color1)
Set the analogous colors.

Since:
v0.1

setComplement

public void setComplement(WheelColor color)
Set the complementary color.

Since:
v0.1

setName

public void setName(String name)
Set the color name.

Since:
v0.1

setType

public void setType(String type)
Set the color type.

Parameters:
type - One of PRIMARY_COLOR, SECONDARY_COLOR, or TERTIARY_COLOR.
Since:
v0.1

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Color
Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02