API Documentation > CorelDRAW > 2025-v26 > Palette > IVGPalette
Palette.GetIndexOfColor method
Gets the index of a color object
Syntax:
Function GetIndexOfColor(ByVal Color As Color) As Long
Parameters:
Name Type Description
Color
Remarks:
The GetIndexOfColor property finds the specified color in the color palette. It returns the index number of the color in the palette. If the color is not found in the palette, it returns Nothing (0).
Examples:
The following VBA example finds the CMYK color cyan in the default palette and displays its index.
Sub Test()
Dim c As New Color
Dim idx As Long
c.CMYKAssign 100, 0, 0, 0
idx = ActivePalette.GetIndexOfColor(c)
MsgBox "Cyan color is at index " & idx 
End Sub