public final class PDColor
extends java.lang.Object
| Constructor | Description |
|---|---|
PDColor(float[] components,
COSName patternName,
PDColorSpace colorSpace) |
Creates a PDColor containing the given color component values and pattern name.
|
PDColor(float[] components,
PDColorSpace colorSpace) |
Creates a PDColor containing the given color component values.
|
PDColor(COSArray array,
PDColorSpace colorSpace) |
Creates a PDColor containing the given color value.
|
PDColor(COSName patternName,
PDColorSpace colorSpace) |
Creates a PDColor containing the given pattern name.
|
| Modifier and Type | Method | Description |
|---|---|---|
PDColorSpace |
getColorSpace() |
Returns the color space in which this color value is defined.
|
float[] |
getComponents() |
Returns the components of this color value.
|
COSName |
getPatternName() |
Returns the pattern name from this color value.
|
boolean |
isPattern() |
Returns true if this color value is a pattern.
|
COSArray |
toCOSArray() |
Returns the color component values as a COS array
|
int |
toRGB() |
Returns the packed RGB value for this color, if any.
|
java.lang.String |
toString() |
public PDColor(COSArray array, PDColorSpace colorSpace)
array - a COS array containing the color valuecolorSpace - color space in which the color value is definedpublic PDColor(float[] components,
PDColorSpace colorSpace)
components - array of color component valuescolorSpace - color space in which the components are definedpublic PDColor(COSName patternName, PDColorSpace colorSpace)
patternName - the name of a pattern in a pattern dictionarycolorSpace - color space in which the pattern is definedpublic PDColor(float[] components,
COSName patternName,
PDColorSpace colorSpace)
components - array of color component valuespatternName - the name of a pattern in a pattern dictionarycolorSpace - color space in which the pattern/components are definedpublic float[] getComponents()
public COSName getPatternName()
public boolean isPattern()
public int toRGB()
throws java.io.IOException
java.io.IOException - if the color conversion failsjava.lang.IllegalStateException - if this color value is a pattern.public COSArray toCOSArray()
public PDColorSpace getColorSpace()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2002–2018. All rights reserved.