API Documentation > CorelDRAW > 2025-v26 > Palette > IVGPalette
Palette.FindColor method
Finds the color by name
Syntax:
Function FindColor(ByVal Name As String) As Long
Parameters:
Name Type Description
Name
String
Remarks:
The FindColor method finds a color by its name. If the name is found in the color palette, it returns the index number of the color in the palette; if the color is not found, it returns Nothing (0).
Examples:
The following VBA example searches the active palette for Red. If the color is not found, it is added to the palette.
Sub Test()
If ActivePalette.FindColor("Red") = 0 Then
  ActivePalette.AddColor CreateRGBColor(255, 0, 0)
End If 
End Sub