Object Model Reference : Classes : P : Palette : Methods : Palette.GetIndexOfColor |
Function GetIndexOfColor(Color As Color) As Long
Member of Palette
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).
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 |
Copyright 2013 Corel Corporation. All rights reserved.