|
JHotDraw 7.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Color org.jhotdraw.color.CompositeColor
public class CompositeColor
CompositeColor
is identical to java.awt.Color
with
the exception that it allows to construct an instance with color components
outside of the range of 0 and 1.
Field Summary |
---|
Fields inherited from class java.awt.Color |
---|
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW |
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
CompositeColor(java.awt.color.ColorSpace cspace,
float[] components,
float alpha)
Creates a color in the specified ColorSpace
with the color components specified in the float
array and the specified alpha. |
Method Summary | |
---|---|
float[] |
getColorComponents(java.awt.color.ColorSpace cspace,
float[] compArray)
Returns a float array containing only the color
components of the Color in the
ColorSpace specified by the cspace
parameter. |
float[] |
getColorComponents(float[] compArray)
Returns a float array containing only the color
components of the Color , in the
ColorSpace of the Color . |
java.awt.color.ColorSpace |
getColorSpace()
Returns the ColorSpace of this Color . |
float[] |
getComponents(java.awt.color.ColorSpace cspace,
float[] compArray)
Returns a float array containing the color and alpha
components of the Color , in the
ColorSpace specified by the cspace
parameter. |
float[] |
getComponents(float[] compArray)
Returns a float array containing the color and alpha
components of the Color , in the
ColorSpace of the Color . |
Methods inherited from class java.awt.Color |
---|
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompositeColor(java.awt.color.ColorSpace cspace, float[] components, float alpha)
ColorSpace
with the color components specified in the float
array and the specified alpha. The number of components is
determined by the type of the ColorSpace
. For
example, RGB requires 3 components, but CMYK requires 4
components.
cspace
- the ColorSpace
to be used to
interpret the componentscomponents
- an arbitrary number of color components
that is compatible with the ColorSpace
alpha
- alpha value
java.lang.IllegalArgumentException
- if any of the values in the
components
array or alpha
is
outside of the range supported by cspace.getComponents(float[])
,
getColorComponents(float[])
Method Detail |
---|
public float[] getComponents(float[] compArray)
float
array containing the color and alpha
components of the Color
, in the
ColorSpace
of the Color
.
If compArray
is null
, an array with
length equal to the number of components in the associated
ColorSpace
plus one is created for
the return value. Otherwise, compArray
must have at
least this length and it is filled in with the components and
returned.
getComponents
in class java.awt.Color
compArray
- an array that this method fills with the color and
alpha components of this Color
in its
ColorSpace
and returns
float
array.public float[] getColorComponents(float[] compArray)
float
array containing only the color
components of the Color
, in the
ColorSpace
of the Color
.
If compArray
is null
, an array with
length equal to the number of components in the associated
ColorSpace
is created for
the return value. Otherwise, compArray
must have at
least this length and it is filled in with the components and
returned.
getColorComponents
in class java.awt.Color
compArray
- an array that this method fills with the color
components of this Color
in its
ColorSpace
and returns
float
array.public float[] getComponents(java.awt.color.ColorSpace cspace, float[] compArray)
float
array containing the color and alpha
components of the Color
, in the
ColorSpace
specified by the cspace
parameter. If compArray
is null
, an
array with length equal to the number of components in
cspace
plus one is created for the return value.
Otherwise, compArray
must have at least this
length, and it is filled in with the components and returned.
getComponents
in class java.awt.Color
cspace
- a specified ColorSpace
compArray
- an array that this method fills with the
color and alpha components of this Color
in
the specified ColorSpace
and returns
float
array.public float[] getColorComponents(java.awt.color.ColorSpace cspace, float[] compArray)
float
array containing only the color
components of the Color
in the
ColorSpace
specified by the cspace
parameter. If compArray
is null
, an array
with length equal to the number of components in
cspace
is created for the return value. Otherwise,
compArray
must have at least this length, and it is
filled in with the components and returned.
getColorComponents
in class java.awt.Color
cspace
- a specified ColorSpace
compArray
- an array that this method fills with the color
components of this Color
in the specified
ColorSpace
float
array.public java.awt.color.ColorSpace getColorSpace()
ColorSpace
of this Color
.
getColorSpace
in class java.awt.Color
Color
object's ColorSpace
.
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |