API Documentation > CorelDRAW > 2025-v26 > FountainColors > IVGFountainColors
FountainColors.AddGrayLevel method
Adds a FountainColor with the Gray Level value to the FountainColors collection
Syntax:
Sub AddGrayLevel(ByVal GrayLevel As Long, ByVal Position As Long)
Parameters:
Name Type Description
GrayLevel
Long
Position
Long
Remarks:
The AddGrayLevel method adds a new grayscale color point at a specified position. If there is a color point at the specified position, the new color point replaces the existing color point. Valid positions range from 1 to 99.
Examples:
The following VBA example creates an ellipse containing a fountain fill with a fountain transparency containing five interleaving transparency points:
Sub Test()
Dim s As Shape
Dim ff As FountainFill
Dim n As Long
Set s = ActiveLayer.CreateEllipse2(4, 5.5, 4)
s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0), , 90
Set ff = s.Transparency.ApplyFountainTransparency(100, 100)
For n = 1 To 5
  ff.Colors.AddGrayLevel (n Mod 2) * 255, n * 100 / 6
Next n 
End Sub