Package com.itextpdf.layout.properties
Class TransparentColor
- java.lang.Object
-
- com.itextpdf.layout.properties.TransparentColor
-
public class TransparentColor extends java.lang.ObjectRepresents a color with the specified opacity.
-
-
Constructor Summary
Constructors Constructor Description TransparentColor(Color color)Creates a newTransparentColorinstance of certain fully opaque color.TransparentColor(Color color, float opacity)Creates a newTransparentColor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyFillTransparency(PdfCanvas canvas)Sets the opacity value for non-stroking operations in the transparent imaging model.voidapplyStrokeTransparency(PdfCanvas canvas)Sets the opacity value for stroking operations in the transparent imaging model.private voidapplyTransparency(PdfCanvas canvas, boolean isStroke)ColorgetColor()Gets the color.floatgetOpacity()Gets the opacity of color.private booleanisTransparent()
-
-
-
Field Detail
-
color
private Color color
-
opacity
private float opacity
-
-
Constructor Detail
-
TransparentColor
public TransparentColor(Color color)
Creates a newTransparentColorinstance of certain fully opaque color.- Parameters:
color- theColorof the createdTransparentColorobject
-
TransparentColor
public TransparentColor(Color color, float opacity)
Creates a newTransparentColor.- Parameters:
color- theColorof the createdTransparentColorobjectopacity- a float defining the opacity of the color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
-
-
Method Detail
-
getOpacity
public float getOpacity()
Gets the opacity of color.- Returns:
- a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
-
applyFillTransparency
public void applyFillTransparency(PdfCanvas canvas)
Sets the opacity value for non-stroking operations in the transparent imaging model.- Parameters:
canvas- thePdfCanvasto be written to
-
applyStrokeTransparency
public void applyStrokeTransparency(PdfCanvas canvas)
Sets the opacity value for stroking operations in the transparent imaging model.- Parameters:
canvas- thePdfCanvasto be written to
-
applyTransparency
private void applyTransparency(PdfCanvas canvas, boolean isStroke)
-
isTransparent
private boolean isTransparent()
-
-