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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(float c) Appends a color to the list.float
getColor
(int i) Returns the color at the given index.A string representation of the current value.short
ImplementsValue.getCssValueType()
.int
Returns the number of colors.boolean
Indicates whether this color uses an N-Channel color space.toString()
Methods inherited from class org.apache.batik.css.engine.value.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:
getCssValueType
in interfaceValue
- Overrides:
getCssValueType
in 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
-