Package com.itextpdf.layout.properties
Class TransparentColor
java.lang.Object
com.itextpdf.layout.properties.TransparentColor
Represents a color with the specified opacity.
-
Constructor Summary
ConstructorDescriptionTransparentColor
(Color color) Creates a newTransparentColor
instance of certain fully opaque color.TransparentColor
(Color color, float opacity) Creates a newTransparentColor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyFillTransparency
(PdfCanvas canvas) Sets the opacity value for non-stroking operations in the transparent imaging model.void
applyStrokeTransparency
(PdfCanvas canvas) Sets the opacity value for stroking operations in the transparent imaging model.getColor()
Gets the color.float
Gets the opacity of color.
-
Constructor Details
-
TransparentColor
Creates a newTransparentColor
instance of certain fully opaque color.- Parameters:
-
color
- theColor
of the createdTransparentColor
object
-
TransparentColor
Creates a newTransparentColor
.- Parameters:
-
color
- theColor
of the createdTransparentColor
object -
opacity
- 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
Gets the color.- Returns:
-
a
Color
-
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
Sets the opacity value for non-stroking operations in the transparent imaging model.- Parameters:
-
canvas
- thePdfCanvas
to be written to
-
applyStrokeTransparency
Sets the opacity value for stroking operations in the transparent imaging model.- Parameters:
-
canvas
- thePdfCanvas
to be written to
-