public final class PDColor extends Object
| Constructor and Description |
|---|
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.
|
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.
|
| Modifier and Type | Method and 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.
|
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 IOException
IOException - if the color conversion failsUnsupportedOperationException - if this color value is a pattern.public COSArray toCOSArray()
public PDColorSpace getColorSpace()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.