net.sourceforge.nite.gui.util
Class ColourFactory

java.lang.Object
  extended by net.sourceforge.nite.gui.util.ColourFactory

public class ColourFactory
extends java.lang.Object

A colour factory is a singleton object that can create text colours and background colours for a certain hue. The text colours will be legible on a white background. The background colours will have a good contrast with black text.


Method Summary
 java.awt.Color getBackgroundColor(double hue)
          Returns a background colour with the specified hue.
static ColourFactory getInstance()
          Returns the singleton colour factory.
 java.awt.Color getTextColour(double hue)
          Returns a text colour with the specified hue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ColourFactory getInstance()

Returns the singleton colour factory.

Returns:
the singleton colour factory

getTextColour

public java.awt.Color getTextColour(double hue)

Returns a text colour with the specified hue.

Parameters:
hue - the hue (between 0.0 and 1.0)
Returns:
the text colour

getBackgroundColor

public java.awt.Color getBackgroundColor(double hue)

Returns a background colour with the specified hue.

Parameters:
hue - the hue (between 0.0 and 1.0)
Returns:
the background colour