Previous Document Next Document

Object Model Reference : Classes : F : FountainColors : Methods : FountainColors.Add


FountainColors.Add

Sub Add(Color As Color, Position As Long)

Description

Member of FountainColors

The Add method places a new color point at the 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.

Parameter
Description
Color
Specifies the color of the new color point. You can use an existing color name or a Create...Color method (for example, CreateCMYKColor, CreateRGBColor).
Position
Specifies the location of the new color point. Valid positions range from 1 to 99 and are expressed as a percentage from the starting position.

VBA example

The following VBA example creates a rectangle and applies a linear fountain fill to it. It then adds two color points to the fill: yellow at 30%, and cyan at 60%.

Sub Test()
 Dim s As Shape
 Set s = ActiveLayer.CreateRectangle(1, 1, 4, 3)
 With s.Fill.ApplyFountainFill(CreateRGBColor(0, 0, 0), CreateRGBColor(255, 0, 0))
  .Colors.Add CreateRGBColor(255, 255, 0), 30
  .Colors.Add CreateRGBColor(0, 255, 255), 60
 End With
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.