src/share/classes/java/awt/Color.java

Print this page




  33 
  34 /**
  35  * The <code>Color</code> class is used to encapsulate colors in the default
  36  * sRGB color space or colors in arbitrary color spaces identified by a
  37  * {@link ColorSpace}.  Every color has an implicit alpha value of 1.0 or
  38  * an explicit one provided in the constructor.  The alpha value
  39  * defines the transparency of a color and can be represented by
  40  * a float value in the range 0.0&nbsp;-&nbsp;1.0 or 0&nbsp;-&nbsp;255.
  41  * An alpha value of 1.0 or 255 means that the color is completely
  42  * opaque and an alpha value of 0 or 0.0 means that the color is
  43  * completely transparent.
  44  * When constructing a <code>Color</code> with an explicit alpha or
  45  * getting the color/alpha components of a <code>Color</code>, the color
  46  * components are never premultiplied by the alpha component.
  47  * <p>
  48  * The default color space for the Java 2D(tm) API is sRGB, a proposed
  49  * standard RGB color space.  For further information on sRGB,
  50  * see <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
  51  * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
  52  * </A>.
  53  * <p>
  54  * @version     10 Feb 1997
  55  * @author      Sami Shaio
  56  * @author      Arthur van Hoff
  57  * @see         ColorSpace
  58  * @see         AlphaComposite
  59  */
  60 public class Color implements Paint, java.io.Serializable {
  61 
  62     /**
  63      * The color white.  In the default sRGB space.
  64      */
  65     public final static Color white     = new Color(255, 255, 255);
  66 
  67     /**
  68      * The color white.  In the default sRGB space.
  69      * @since 1.4
  70      */
  71     public final static Color WHITE = white;
  72 
  73     /**




  33 
  34 /**
  35  * The <code>Color</code> class is used to encapsulate colors in the default
  36  * sRGB color space or colors in arbitrary color spaces identified by a
  37  * {@link ColorSpace}.  Every color has an implicit alpha value of 1.0 or
  38  * an explicit one provided in the constructor.  The alpha value
  39  * defines the transparency of a color and can be represented by
  40  * a float value in the range 0.0&nbsp;-&nbsp;1.0 or 0&nbsp;-&nbsp;255.
  41  * An alpha value of 1.0 or 255 means that the color is completely
  42  * opaque and an alpha value of 0 or 0.0 means that the color is
  43  * completely transparent.
  44  * When constructing a <code>Color</code> with an explicit alpha or
  45  * getting the color/alpha components of a <code>Color</code>, the color
  46  * components are never premultiplied by the alpha component.
  47  * <p>
  48  * The default color space for the Java 2D(tm) API is sRGB, a proposed
  49  * standard RGB color space.  For further information on sRGB,
  50  * see <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
  51  * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
  52  * </A>.
  53  *
  54  * @version     10 Feb 1997
  55  * @author      Sami Shaio
  56  * @author      Arthur van Hoff
  57  * @see         ColorSpace
  58  * @see         AlphaComposite
  59  */
  60 public class Color implements Paint, java.io.Serializable {
  61 
  62     /**
  63      * The color white.  In the default sRGB space.
  64      */
  65     public final static Color white     = new Color(255, 255, 255);
  66 
  67     /**
  68      * The color white.  In the default sRGB space.
  69      * @since 1.4
  70      */
  71     public final static Color WHITE = white;
  72 
  73     /**