Class DeviceColor

java.lang.Object
org.apache.batik.css.engine.value.AbstractValue
org.apache.batik.css.engine.value.svg12.DeviceColor
All Implemented Interfaces:
Value

public class DeviceColor extends AbstractValue
This class represents an device-specific color value.
Version:
$Id: DeviceColor.java 1617286 2014-08-11 14:03:51Z lbernardo $
  • Field Details

    • DEVICE_GRAY_COLOR_FUNCTION

      public static final String DEVICE_GRAY_COLOR_FUNCTION
      See Also:
    • DEVICE_RGB_COLOR_FUNCTION

      public static final String DEVICE_RGB_COLOR_FUNCTION
      See Also:
    • DEVICE_CMYK_COLOR_FUNCTION

      public static final String DEVICE_CMYK_COLOR_FUNCTION
      See Also:
    • DEVICE_NCHANNEL_COLOR_FUNCTION

      public static final String DEVICE_NCHANNEL_COLOR_FUNCTION
      See Also:
    • nChannel

      protected boolean nChannel
    • count

      protected int count
      The color count.
    • colors

      protected float[] colors
      The 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()
      Specified by:
      getCssValueType in interface Value
      Overrides:
      getCssValueType in class AbstractValue
    • isNChannel

      public boolean isNChannel()
      Indicates whether this color uses an N-Channel color space.
      Returns:
      true if N-Channel is used
    • getNumberOfColors

      public int getNumberOfColors() throws DOMException
      Returns the number of colors.
      Throws:
      DOMException
    • getColor

      public float getColor(int i) throws DOMException
      Returns the color at the given index.
      Throws:
      DOMException
    • getCssText

      public String getCssText()
      A string representation of the current value.
    • append

      public void append(float c)
      Appends a color to the list.
    • toString

      public String toString()
      Overrides:
      toString in class Object