Top Description Fields Constructors Methods
de.rototor.pdfbox.graphics2d

public Class PdfBoxGraphics2DColor

extends Color
implements IPdfBoxGraphics2DColor
Class Inheritance
All Implemented Interfaces
de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColor
Known Direct Subclasses
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DCMYKColor
Imports
org.apache.pdfbox.pdmodel.graphics.color.PDColor, java.awt.*, java.io.IOException

Universal PDColor Carrying class. It does not assume any specific colorspace. Useful for e.g. speration colors

Field Summary

Modifier and TypeField and Description
private final int
private final PDColor
private final boolean
Inherited from java.awt.Color:
blackBLACKblueBLUEcyanCYANDARK_GRAYdarkGraygrayGRAYgreenGREENLIGHT_GRAYlightGraymagentaMAGENTAorangeORANGEpinkPINKredREDwhiteWHITEyellowYELLOW

Constructor Summary

AccessConstructor and Description
public
PdfBoxGraphics2DColor(PDColor
the PDColor
color
)

public
PdfBoxGraphics2DColor(PDColor
the PDColor
color
,
int
the alpha to use
alpha
)

public
PdfBoxGraphics2DColor(PDColor
the PDColor
color
,
int
the alpha to use
alpha
,
boolean
determine if overprint should be used
overprint
)

Method Summary

Modifier and TypeMethod and Description
public int
getAlpha()

Overrides java.awt.Color.getAlpha.

Returns the alpha component in the range 0-255.

public boolean
public PDColor
private static int
toRGBValue(PDColor color, int alpha)

Inherited from java.awt.Color:
brightercreateContextdarkerdecodeequalsgetBluegetColorgetColorgetColorgetColorComponentsgetColorComponentsgetColorSpacegetComponentsgetComponentsgetGreengetHSBColorgetRedgetRGBgetRGBColorComponentsgetRGBComponentsgetTransparencyhashCodeHSBtoRGBRGBtoHSBtoString

Field Detail

alphaback to summary
private final int alpha
colorback to summary
private final PDColor color
overprintback to summary
private final boolean overprint

Constructor Detail

PdfBoxGraphics2DColorback to summary
public PdfBoxGraphics2DColor(PDColor color)
Parameters
color:PDColor

the PDColor

PdfBoxGraphics2DColorback to summary
public PdfBoxGraphics2DColor(PDColor color, int alpha)
Parameters
color:PDColor

the PDColor

alpha:int

the alpha to use

PdfBoxGraphics2DColorback to summary
public PdfBoxGraphics2DColor(PDColor color, int alpha, boolean overprint)
Parameters
color:PDColor

the PDColor

alpha:int

the alpha to use

overprint:boolean

determine if overprint should be used

Method Detail

getAlphaback to summary
public int getAlpha()

Overrides java.awt.Color.getAlpha.

Doc from java.awt.Color.getAlpha.

Returns the alpha component in the range 0-255.

Returns:int

the alpha component.

Annotations
@Override
isOverprintback to summary
public boolean isOverprint()

Implements de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColor.isOverprint.

Returns:boolean

Doc from de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColor.isOverprint.

true if this color should be applied with overprint

toPDColorback to summary
public PDColor toPDColor()

Implements de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColor.toPDColor.

Returns:PDColor

Doc from de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColor.toPDColor.

the PDColor represented by this color object

toRGBValueback to summary
private static int toRGBValue(PDColor color, int alpha)