com.arsdigita.bebop.util
Class Color

java.lang.Object
  extended bycom.arsdigita.bebop.util.Color

public class Color
extends Object

A class for Bebop color parameters.

 private Page buildSomePage() {
     Page page = new Page("Some Page");

     Label label = new Label("Some Text");

     // Make the label text green.
     label.setColor(new Color(0,255,0));

     // Here's another way of doing the same thing.
     label.setColor(Color.green);

     page.add(label);

     page.lock();

     return page;
 }
 

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/util/Color.java#9 $
Author:
Jim Parsons

Field Summary
static Color black
          An instance of the color black.
static Color blue
          An instance of the color blue.
static Color cyan
          An instance of the color cyan.
static Color darkGray
          An instance of the color darkGray.
static Color gray
          An instance of the color gray.
static Color green
          An instance of the color green.
static Color lightGray
          An instance of the color lightGray.
static Color magenta
          An instance of the color magenta.
static Color nobukoBlue
          An instance of the color nobukoBlue, an exotic medium torquoise.
static Color orange
          An instance of the color orange.
static Color pink
          An instance of the color pink.
static Color red
          An instance of the color red.
static String versionId
           
static Color white
          An instance of the color white.
static Color yellow
          An instance of the color yellow.
 
Constructor Summary
Color(float redValue, float greenValue, float blueValue)
          Make a color from the constituents red, green, and blue.
Color(int redValue, int greenValue, int blueValue)
          Make a color from the constituents red, green, and blue.
 
Method Summary
 String toHTMLString()
          Produce an HTML hex-based representation of this color.
 String toString()
          Return a string with hex values padded out two places with a leading 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

black

public static final Color black
An instance of the color black.


blue

public static final Color blue
An instance of the color blue.


cyan

public static final Color cyan
An instance of the color cyan.


darkGray

public static final Color darkGray
An instance of the color darkGray.


gray

public static final Color gray
An instance of the color gray.


green

public static final Color green
An instance of the color green.


lightGray

public static final Color lightGray
An instance of the color lightGray.


magenta

public static final Color magenta
An instance of the color magenta.


orange

public static final Color orange
An instance of the color orange.


pink

public static final Color pink
An instance of the color pink.


red

public static final Color red
An instance of the color red.


white

public static final Color white
An instance of the color white.


yellow

public static final Color yellow
An instance of the color yellow.


nobukoBlue

public static final Color nobukoBlue
An instance of the color nobukoBlue, an exotic medium torquoise.

Constructor Detail

Color

public Color(int redValue,
             int greenValue,
             int blueValue)
Make a color from the constituents red, green, and blue. Each color argument is an integer in the range of 0 to 255.


Color

public Color(float redValue,
             float greenValue,
             float blueValue)
Make a color from the constituents red, green, and blue. Each color argument is a float in the range of 0 to 1.

Method Detail

toString

public String toString()
Return a string with hex values padded out two places with a leading 0.

Returns:
a string representing this color.

toHTMLString

public String toHTMLString()
Produce an HTML hex-based representation of this color.

Returns:
an HTML hex color.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC