[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# ColorIndex

Finds the position in the color identifier map for the specified value.

## Declaration

Source position: graphics.pp line 1930

`function ColorIndex(`
`Color: LongInt;`
`out Index: Integer`
`):Boolean;`

## Arguments

`Color` |  | Color value to locate in Colors.
`Index` |  | Position in Colors where the color value was found.

## Function result

True when the color value exists in Colors.

## Description

ColorIndex is a Boolean function used to determine if the color value specified in Color exists in the color value to name identifier map.

ColorIndex iterates over the values in the Colors constant to find an element in the array with the value specified in Color. The position for the value is assigned to the Index output parameter. The return value is True when a value is located in Colors. Otherwise, the return value is False. The value in Index is not significant when the return value is False.

## See also

IdentToColor |  | IdentToColor - given a color identifier (name) returns the color value.
ColorToIdent |  | ColorToIdent - given a Color value, find its name (Ident) in the look-up table of Colors.