API Documentation > CorelDRAW > 2025-v26 > StructPaletteOptions > IVGStructPaletteOptions
StructPaletteOptions.TargetColor property
Syntax:
Property Get TargetColor() As Long
Property Let TargetColor(ByVal Value As Long)
Remarks:
The TargetColor property is a value that represents an RGB color to be used as a color target when generating a palette. You can use the RGB function in Visual Basic to build the color value.
Examples:
The following VBA example exports the current page to a GIF image and ensures that the color blue is in the resulting palette:
Sub Test()
Dim pal As New StructPaletteOptions
Dim flt As ExportFilter
pal.NumColors = 10
pal.PaletteType = cdrPaletteOptimized
pal.ColorSensitive = True
pal.TargetColor = RGB(0, 0, 255)
pal.Importance = 200
pal.Lightness = 300
pal.ToleranceA = 100
pal.ToleranceB = 100
Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)
flt.Finish 
End Sub