Previous Document Next Document

Object Model Reference : Classes : P : Palette : Methods : Palette.GetIndexOfColor


Palette.GetIndexOfColor

Function GetIndexOfColor(Color As Color) As Long

Description

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).

Parameter
Description
Color
Specifies the color

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.