332
Table 5.35 Gradient — Properties
Property
Type
Table 5.36 Gradient — Methods
Method
Delete()
Notes
Illustrator's Gradient object represents a gradient as defined in the Illustrator application.
Additional gradients may be created by the user within Illustrator or via a script.
Example 20.1
This example shows how you can create a new gradient and apply it as a fill pattern to the
frontmost PathItem.
Dim appRef As New Illustrator.Application
Dim frontDocument As Illustrator.Document
Dim newGradient As Illustrator.Gradient
Dim locationSpecification As Illustrator.GradientStop
Set frontDocument = appRef.ActiveDocument
'Create a color for both ends of the gradient
Dim startColor As New Illustrator.RGBColor
Dim endColor As New Illustrator.RGBColor
startColor.Red = 0
startColor.Green = 100
startColor.Blue = 255
endColor.Red = 220
endColor.Green = 0
endColor.Blue = 100
'Create a new gradient
'A new gradient always have 2 stops
Set newGradient = frontDocument.Gradients.Add
newGradient.Name = "Gradient created from script"
newGradient.Type = aiLinearGradient
R/O
Value type
AiGradientType
enumeration
Returns
Nothing
12 Aug 03
Visual Basic Reference
What it is
The kind of the gradient, either radial or
linear
What it does
Delete the object