Previous Document Next Document

Object Model Reference : Classes : P : Palettes : Methods : Palettes.Create


Palettes.Create

Function Create(Name As String, [FileName As String], [Overwrite As Boolean = False]) As Palette

Description

Member of Palettes

The Create method creates a new empty custom color palette.

Parameter
Description
Name
Specifies the name of the new palette
FileName
Specifies the path and filename for the palette. This parameter is optional.
Overwrite
Specifies whether to overwrite the default palette. If this value is set to True, the new palette replaces the default palette. If it is set to False, the new palette coexists with the default palette. This parameter is optional, and its default value is False.

VBA example

The following VBA example creates a new palette and adds colors with different shades of cyan varying by steps of 5%.

Sub Test()
 Dim pal As Palette
 Dim lvl As Long
 Dim c As New Color
 Set pal = Palettes.Create("Shades of Cyan", Application.UserDataPath & _
  "Palettes\CyanShades.xml", True)
 For lvl = 0 To 100 Step 5
  c.CMYKAssign lvl, 0, 0, 0
  pal.AddColor c
 Next lvl
 pal.Save
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.