Meet us at PRINT 19. Chicago, IL. Oct. 3 - 5.
This documentation is for the old version. Go to the latest Graphics Mill docs

ColorPalette.FindNearestIndex Method

Searches index of the color closest to given one.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Function FindNearestIndex ( _
	color As RgbColor _
) As Integer
C#
public int FindNearestIndex(
	RgbColor color
)

Parameters

color

Type: Aurigma.GraphicsMill.RgbColor

Color value to find.

Return Value

Index of the palette entry which is closest to given color value.

Examples

Visual Basic
Dim red As Aurigma.GraphicsMill.RgbColor = _
 Aurigma.GraphicsMill.RgbColor.Red

Dim index As Integer = palette.FindNearestIndex(red)

Console.WriteLine(index)
C#
Aurigma.GraphicsMill.RgbColor red = Aurigma.GraphicsMill.RgbColor.Red;

int index = palette.FindNearestIndex(red);

Console.WriteLine(index);

See Also

Reference