Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

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

Signature
C#
C#
 public Color GetColor(int red, int green, int blue)
Signature
vb.net
vb.net
Public Function GetColor(ByVal red As Integer, ByVal green As Integer, ByVal blue As Integer) As Color
Parameters
Param
red
red

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

Param
green
green

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

Param
blue
blue

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

Returns

A

Msdn
System.Drawing.Color
System.Drawing.Color
1Color
object representing the color with the specified RGB value.

Exceptions
Exception
System.ArgumentOutOfRangeException
System.ArgumentOutOfRangeException

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

Remarks

For .xls files, an exception will be thrown if no color in the palette has the specified RGB value. For .xlsx files, a color will be returned for any RGB values.

Example
Code Block
csharp
csharp
titleC#
Color blue = pal.GetColor(0, 0, 255);
Code Block
vb.net
vb.net
titlevb.net
Dim blue As Color = pal.GetColor(0, 0, 255)