Returns a Color representing the specified color, and throws an exception if the file does not support the specified color.

 public Color GetColor(System.Drawing.Color color)
Public Function GetColor(ByVal color As System.Drawing.Color) As Color

For .xls files, an exception will be thrown if the color is not in the palette. For .xlsx files, a Color will always be returned.

The desired color.

A object in the palette that matches the specified color.

Color clr = pal.GetColor(System.Drawing.Color.Red);
Dim clr As Color = pal.GetColor(System.Drawing.Color.Red)