Class DeviceColor
java.lang.Object
org.apache.batik.css.engine.value.AbstractValue
org.apache.batik.css.engine.value.svg12.DeviceColor
- All Implemented Interfaces:
Value
This class represents an device-specific color value.
- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(float c) Appends a color to the list.floatgetColor(int i) Returns the color at the given index.A string representation of the current value.shortImplementsValue.getCssValueType().intReturns the number of colors.booleanIndicates whether this color uses an N-Channel color space.toString()Methods inherited from class AbstractValue
createDOMException, getBlue, getBottom, getFloatValue, getGreen, getIdentifier, getLeft, getLength, getListStyle, getPrimitiveType, getRed, getRight, getSeparator, getStringValue, getTop, item
-
Field Details
-
DEVICE_GRAY_COLOR_FUNCTION
- See Also:
-
DEVICE_RGB_COLOR_FUNCTION
- See Also:
-
DEVICE_CMYK_COLOR_FUNCTION
- See Also:
-
DEVICE_NCHANNEL_COLOR_FUNCTION
- See Also:
-
nChannel
protected boolean nChannel -
count
protected int countThe color count. -
colors
protected float[] colorsThe colors.
-
-
Constructor Details
-
DeviceColor
public DeviceColor(boolean nChannel) Creates a new DeviceColor.- Parameters:
nChannel- true for a device-nchannel() color, false for Gray, RGB and CMYK
-
-
Method Details
-
getCssValueType
public short getCssValueType()ImplementsValue.getCssValueType().- Specified by:
getCssValueTypein interfaceValue- Overrides:
getCssValueTypein classAbstractValue
-
isNChannel
public boolean isNChannel()Indicates whether this color uses an N-Channel color space.- Returns:
- true if N-Channel is used
-
getNumberOfColors
Returns the number of colors.- Throws:
DOMException
-
getColor
Returns the color at the given index.- Throws:
DOMException
-
getCssText
A string representation of the current value. -
append
public void append(float c) Appends a color to the list. -
toString
-