Class TransparentColor
java.lang.Object
com.itextpdf.layout.properties.TransparentColor
Represents a color with the specified opacity.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTransparentColor(Color color) Creates a newTransparentColorinstance of certain fully opaque color.TransparentColor(Color color, float opacity) Creates a newTransparentColor. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyFillTransparency(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) getColor()Gets the color.floatGets the opacity of color.private boolean
-
Field Details
-
color
-
opacity
private float opacity
-
-
Constructor Details
-
TransparentColor
Creates a newTransparentColorinstance of certain fully opaque color.- Parameters:
color- theColorof the createdTransparentColorobject
-
TransparentColor
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 Details
-
getColor
-
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
-
applyStrokeTransparency
-
applyTransparency
-
isTransparent
private boolean isTransparent()
-