de.dante.extex.color.model
Class ColorFactory

java.lang.Object
  extended byde.dante.extex.color.model.ColorFactory

public final class ColorFactory
extends java.lang.Object

This factory can be used to acquire Color objects. This factory is provided as a singleton in a utility class. Thus all methods are implemented as static methods.

Version:
$Revision: 1.3 $
Author:
Gerd Neugebauer

Field Summary
static Color BLACK
          The constant BLACK contains the color black.
static Color WHITE
          The constant WHITE contains the color white.
 
Method Summary
static CmykColor getCmyk(int cyan, int magenta, int yellow, int black, int alpha)
          Get a new color in the CMYK color model.
static GrayscaleColor getGray(int gray, int alpha)
          Get a new color in the grayscale color model.
static HsvColor getHsv(int hue, int saturation, int value, int alpha)
          Get a new color in the HSV color model.
static RgbColor getRgb(int red, int green, int blue, int alpha)
          Get a new color in the RGB color model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

public static final Color BLACK
The constant BLACK contains the color black.


WHITE

public static final Color WHITE
The constant WHITE contains the color white.

Method Detail

getCmyk

public static CmykColor getCmyk(int cyan,
                                int magenta,
                                int yellow,
                                int black,
                                int alpha)
Get a new color in the CMYK color model.

Parameters:
cyan - the cyan value
magenta - the magenta value
yellow - the yellow value
black - the black value
alpha - the alpha channel
Returns:
the new color

getGray

public static GrayscaleColor getGray(int gray,
                                     int alpha)
Get a new color in the grayscale color model.

Parameters:
gray - the gray value
alpha - the alpha channel
Returns:
the new color

getHsv

public static HsvColor getHsv(int hue,
                              int saturation,
                              int value,
                              int alpha)
Get a new color in the HSV color model.

Parameters:
hue - the hue value
saturation - the saturation value
value - the value
alpha - the alpha channel
Returns:
the new color

getRgb

public static RgbColor getRgb(int red,
                              int green,
                              int blue,
                              int alpha)
Get a new color in the RGB color model.

Parameters:
red - the red value
green - the green value
blue - the blue value
alpha - the alpha channel
Returns:
the new color