org.zkoss.zuss.util
Class Color

java.lang.Object
  extended by org.zkoss.zuss.util.Color
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>

public class Color
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

Represents a color.

Author:
tomyeh

Field Summary
 int blue
           
 int green
           
 int red
           
 
Constructor Summary
Color(int value)
           
Color(int red, int green, int blue)
           
Color(java.lang.String rgb)
           
 
Method Summary
 Color add(java.lang.Object o)
          Returns a color that adds this color and the given object.
 int compareTo(java.lang.Object o)
          Compares with another object
 Color divide(java.lang.Object o)
          Returns a color that divides this color with the given object.
 boolean equals(java.lang.Object o)
           
static Color getColor(java.lang.String rgb)
          Returns the color of the given name.
static Color getStandardColor(java.lang.String name)
          Returns the starndard color, or null if it is not a standard color.
 int getValue()
          Returns an integer representing this color
 int hashCode()
           
 Color multiply(java.lang.Object o)
          Returns a color that multiplies this color with the given object.
 Color negate()
          Return a color that negates this color.
 Color subtract(java.lang.Object o)
          Returns a color that subtracts this color and the given object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

red

public final int red

green

public final int green

blue

public final int blue
Constructor Detail

Color

public Color(int value)

Color

public Color(java.lang.String rgb)

Color

public Color(int red,
             int green,
             int blue)
Method Detail

getColor

public static Color getColor(java.lang.String rgb)
Returns the color of the given name.


getStandardColor

public static Color getStandardColor(java.lang.String name)
Returns the starndard color, or null if it is not a standard color.


negate

public Color negate()
Return a color that negates this color.


add

public Color add(java.lang.Object o)
Returns a color that adds this color and the given object.


subtract

public Color subtract(java.lang.Object o)
Returns a color that subtracts this color and the given object.


multiply

public Color multiply(java.lang.Object o)
Returns a color that multiplies this color with the given object.


divide

public Color divide(java.lang.Object o)
Returns a color that divides this color with the given object.


compareTo

public int compareTo(java.lang.Object o)
Compares with another object

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>

getValue

public int getValue()
Returns an integer representing this color


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2005-2010 Potix Corporation. All Rights Reserved.