Version

GetIndexOfNearestColor Method

Gets the index of the closest color in the color palette, which will be seen when the file is opened in Microsoft Excel 2003 and older versions.
Syntax
'Declaration
 
Public Function GetIndexOfNearestColor( _
   ByVal color As System.Drawing.Color _
) As System.Integer
public System.int GetIndexOfNearestColor( 
   System.Drawing.Color color
)

Parameters

color
The color to match in the palette.

Return Value

A 0-based index into the collection of the closest color available in the palette.
Requirements

Target Platforms: Windows 8.1, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

View on GitHub