Packageorg.purepdf.utils
Classpublic class ShadingUtils
InheritanceShadingUtils Inheritance Object



Public Methods
 MethodDefined By
  
drawRadialGradient(cb:PdfContentByte, x:Number, y:Number, r0:Number, r1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, alpha:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):void
[static]
ShadingUtils
  
drawRectangleGradient(cb:PdfContentByte, x:Number, y:Number, width:Number, height:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, alpha:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):void
[static] Draws a rectangle with a multiple alpha gradient colors Example: var colors: Vector.<RGBColor> = Vector.<RGBColor>([ RGBColor.BLACK, RGBColor.YELLOW, RGBColor.RED, RGBColor.CYAN ] ); var ratios: Vector.<Number> = Vector.<Number>([0, 0.5, 0.7, 1]); var alphas: Vector.<Number> = Vector.<Number>([ 0, 0.2, 0.3, 0.6 ]); ShadingUtils.drawRectangleGradient( cb, 100, 100, 100, PageSize.A4.height - 200, colors, ratios, alphas );
ShadingUtils
Method Detail
drawRadialGradient()method
public static function drawRadialGradient(cb:PdfContentByte, x:Number, y:Number, r0:Number, r1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, alpha:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):void

Parameters

cb:PdfContentByte
 
x:Number
 
y:Number
 
r0:Number
 
r1:Number
 
colors:Vector.<RGBColor>
 
ratios:Vector.<Number>
 
alpha:Vector.<Number>
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)

drawRectangleGradient()method 
public static function drawRectangleGradient(cb:PdfContentByte, x:Number, y:Number, width:Number, height:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, alpha:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):void

Draws a rectangle with a multiple alpha gradient colors Example:

		 var colors: Vector.<RGBColor> 	= Vector.<RGBColor>([ RGBColor.BLACK, RGBColor.YELLOW, RGBColor.RED, RGBColor.CYAN ] );
		 var ratios: Vector.<Number>		= Vector.<Number>([0, 0.5, 0.7, 1]);
		 var alphas: Vector.<Number>		= Vector.<Number>([ 0, 0.2, 0.3, 0.6 ]);
		 ShadingUtils.drawRectangleGradient( cb, 100, 100, 100, PageSize.A4.height - 200, colors, ratios, alphas ); 
		 

Parameters

cb:PdfContentByte
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
colors:Vector.<RGBColor> — Vector of RGBColor
 
ratios:Vector.<Number> — Vector of numbers ( 0 to 1 )
 
alpha:Vector.<Number> — Vector of numbers ( 0 to 1 )
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)