Class Color
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Color

public class netscape.application.Color
    extends java.lang.Object
    implements netscape.util.Codable
{
    /* Fields
     */
    public final static String COLOR_TYPE;
    public final static Color black;
    public final static Color blue;
    public final static Color cyan;
    public final static Color darkGray;
    public final static Color gray;
    public final static Color green;
    public final static Color lightGray;
    public final static Color magenta;
    public final static Color orange;
    public final static Color pink;
    public final static Color red;
    public final static Color white;
    public final static Color yellow;

    /* Constructors
     */
    public Color();
    public Color(int, int, int);
    public Color(int);
    public Color(float, float, float);

    /* Methods
     */
    public static Color colorForHSB(float, float, float);
    public static int rgbForHSB(float, float, float);

    public int blue();
    public Color darkerColor();
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void encode(Encoder);
    public boolean equals(Object);
    public void finishDecoding();
    public int green();
    public int hashCode();
    public Color lighterColor();
    public int red();
    public int rgb();
    public String toString();
}
Object subclass representing a color.

Fields

red

  public final static Color red
The color red.

green

  public final static Color green
The color green.

blue

  public final static Color blue
The color blue.

cyan

  public final static Color cyan
The color cyan.

magenta

  public final static Color magenta
The color magenta.

yellow

  public final static Color yellow
The color yellow.

orange

  public final static Color orange
The color orange.

pink

  public final static Color pink
The color pink.

white

  public final static Color white
The color white.

lightGray

  public final static Color lightGray
The color light gray (75% white).

gray

  public final static Color gray
The color gray (50% white).

darkGray

  public final static Color darkGray
The color dark gray (25% white).

black

  public final static Color black
The color black.

COLOR_TYPE

  public final static String COLOR_TYPE
Drag and Drop data type.
See Also:
DragSession

Constructors

.Color

  public Color()
Constructs a Color. This constructor is only useful during decoding.
See Also:
Color(int, int, int), Color(int), Color(float, float, float)

.Color

  public Color(int red,
               int green,
               int blue)
Constructs a Color for the given red, green, and blue values. These values must be in the range 0-255.

.Color

  public Color(int rgb)
Constructs a Color for the given red, green, and blue values, where red is specified by rgb bits 16-23, green by bits 8-15, and blue by bits 0-7.

.Color

  public Color(float red,
               float green,
               float blue)
Constructs a Color for the given red, green, and blue values. These values must be in the range 0.0-1.0.

Methods

.rgbForHSB

  public static int rgbForHSB(float hue,
                              float saturation,
                              float brightness)
Returns the RGB value for the given hue, saturation, and brightness values.

.colorForHSB

  public static Color colorForHSB(float hue,
                                  float saturation,
                                  float brightness)
Returns a Color for the given hue, saturation, and brightness values.

.red

  public int red()
Returns the Color's red component, in the range 0-255.

.green

  public int green()
Returns the Color's green component, in the range 0-255.

.blue

  public int blue()
Returns the Color's blue component, in the range 0-255.

.rgb

  public int rgb()
Returns the Color's rgb value, where bits 16-23 represent red, bits 8-15 represent green, and bits 0-7 represent blue.

.hashCode

  public int hashCode()
Returns the Color's hash code.
Overrides:
hashCode in class Object

.equals

  public boolean equals(Object anObject)
Returns true if anObject equals the Color.
Overrides:
equals in class Object

.toString

  public String toString()
Returns the Color's String representation.
Overrides:
toString in class Object

.lighterColor

  public Color lighterColor()
Returns a "lighter" version of this Color.
See Also:
darkerColor

.darkerColor

  public Color darkerColor()
Returns a "darker" version of this Color.
See Also:
lighterColor

.describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the Color class' coding information.
See Also:
describeClassInfo

.encode

  public void encode(Encoder encoder) throws CodingException
Encodes the Color.
See Also:
encode

.decode

  public void decode(Decoder decoder) throws CodingException
Decodes the Color.
See Also:
decode

.finishDecoding

  public void finishDecoding() throws CodingException
Finishes the Color's decoding.
See Also:
finishDecoding

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997