API Documentation > CorelDRAW > 2025-v26 > Palette > IVGPalette
Palette.RemoveColor method
Removes a color from a custom color palette
Syntax:
Sub RemoveColor(ByVal Index As Long)
Parameters:
Name Type Description
Index
Long
Remarks:
The RemoveColor method removes the specified color from a color palette.
Examples:
The following VBA example duplicates the default palette and then removes all dark colors (the colors that have a lightness less than 50%) from it.
Sub Test()
Dim c As New Color
Dim src As Palette, dest As Palette
Dim idx As Long
Set src = ActivePalette
Set dest = Palettes.Create("Bright Colors")
For Each c In src.Colors
  dest.AddColor c
Next c
For idx = dest.ColorCount To 1 Step -1
  c.CopyAssign dest.Color(idx)
  c.ConvertToHLS
  If c.HLSLightness < 128 Then dest.RemoveColor idx
  Next idx

End Sub