Page tree
Skip to end of metadata
Go to start of metadata

Description

Returns the closest color to the specified RGB value that the file can support.

C#
vb.net

Parameters

red
The red component of the desired color. Must be between 0 and 255.
green
The green component of the desired color. Must be between 0 and 255.
blue
The blue component of the desired color. Must be between 0 and 255.

Returns

The closest color in the palette to the specified RGB value

Exceptions

System.ArgumentOutOfRangeException
If the given red, green, or blue value is not between 0 and 255.

Remarks

For .xls files, this will be the color in the palette that has the minimum difference between the specified RGB value and its RGB value. .xlsx files are not limited to colors in the palette, and will return a Color representing the specified RGB values exactly.

Examples

C#
vb.net
  • No labels