public abstract class OMSVGColor extends OMCSSValue
The OMSVGColor
interface corresponds
to color value definition for properties stop-color
, flood-color
and lighting-color
and is a base class for interface OMSVGPaint
. It incorporates SVG's extended notion
of color, which incorporates ICC-based color specifications.
Interface
OMSVGColor
does not correspond
to the <color> basic data
type. For the <color> basic
data type, the applicable DOM interfaces are defined in DOM
Level 2 Style; in particular, see the RGBColor
interface
([DOM2STYLE], section 2.2).
Note:
The OMSVGColor
interface is deprecated,
and may be dropped from future versions of the SVG specification.
Modifier and Type | Field and Description |
---|---|
protected short |
colorType |
protected OMSVGICCColor |
iccColor |
protected OMRGBColor |
rgbColor |
static short |
SVG_COLORTYPE_CURRENTCOLOR
Corresponds to when keyword currentColor
has been specified.
|
static short |
SVG_COLORTYPE_RGBCOLOR
An sRGB color has been specified without an alterICC color specification.
|
static short |
SVG_COLORTYPE_RGBCOLOR_ICCCOLOR
An sRGB color has been specified along with an alterICC color specification.
|
static short |
SVG_COLORTYPE_UNKNOWN
The color type is not one of predefined types.
|
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST, cssText, cssValueType
Modifier | Constructor and Description |
---|---|
protected |
OMSVGColor() |
Modifier and Type | Method and Description |
---|---|
short |
getColorType()
The type of the value as specified by one of the SVG_COLORTYPE_ constants
defined on this interface.
|
OMSVGICCColor |
getIccColor()
The alternate ICC color specification.
|
OMRGBColor |
getRgbColor()
The color specified in the sRGB color space.
|
void |
setColor(short colorType,
String rgbColor,
String iccColor)
Sets the color value as specified by the parameters.
|
void |
setRGBColor(String rgbColor)
Modifies the color value to be the specified sRGB color without an alternate
ICC color specification.
|
void |
setRGBColorICCColor(String rgbColor,
String iccColor)
Modifies the color value to be the specified sRGB color with an alternate
ICC color specification.
|
getCssText, getCssValueType, getDescription, setCssText, toString
public static final short SVG_COLORTYPE_UNKNOWN
public static final short SVG_COLORTYPE_RGBCOLOR
public static final short SVG_COLORTYPE_RGBCOLOR_ICCCOLOR
public static final short SVG_COLORTYPE_CURRENTCOLOR
protected short colorType
protected OMRGBColor rgbColor
protected OMSVGICCColor iccColor
public final short getColorType()
public final OMRGBColor getRgbColor()
public final OMSVGICCColor getIccColor()
public final void setRGBColor(String rgbColor) throws com.google.gwt.core.client.JavaScriptException
public final void setRGBColorICCColor(String rgbColor, String iccColor) throws com.google.gwt.core.client.JavaScriptException
rgbColor
- A string that matches <color>,
which specifies the new sRGB color value.iccColor
- A string that matches <icccolor>,
which specifies the alternate ICC color specification.SVGException(SVG_INVALID_VALUE_ERR)
- Raised if rgbColor
does not match <color> or
if iccColor does not match <icccolor>.com.google.gwt.core.client.JavaScriptException
public final void setColor(short colorType, String rgbColor, String iccColor) throws com.google.gwt.core.client.JavaScriptException
RGBColor
, then rgbColor must be a string
that matches <color>; otherwise,
rgbColor. must be null. If colorType requires an
OMSVGICCColor
, then iccColor
must be a string that matches <icccolor>;
otherwise, iccColor must be null.colorType
- One of the defined constants for getColorType()
.rgbColor
- The specification of an sRGB color, or null.iccColor
- The specification of an ICC color, or null.SVGException(SVG_INVALID_VALUE_ERR)
- Raised if one of the parameters
has an invalid value.com.google.gwt.core.client.JavaScriptException
Copyright © 2018. All Rights Reserved.