Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
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#
Wiki Markup
{description}
{excerpt}Returns a color representing the specified RGB value, and throws an exception if the file does not support the specified color.{excerpt}
{signature:C#}
 public Color GetColor(int red, int green, int blue)
Signature
{signature}{signature:vb.net
vb.net
}
Public Function GetColor(ByVal red As Integer, ByVal green As Integer, ByVal blue As Integer) As Color
Parameters

...

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

...

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

...

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

...

Exceptions

...

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.

{signature}
{parameters}
{param:red}The red component of the desired color. Must be between 0 and 255.{param}
{param:green}the green component of the desired color. Must be between 0 and 255.{param}
{param:blue}the blue component of the desired color. Must be between 0 and 255.{param}
{returns}A {msdn:System.Drawing.Color|Color} object representing the color with the specified RGB value.{returns}
{exceptions}
{exception:System.ArgumentOutOfRangeException}If the given red, green, or blue value is not between 0 and 255.{exception}
{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.
{remarks}
{example}{code:csharp|title=C#}
Color blue = pal.GetColor(0, 0, 255);
{code}
{code:vb.net
|title=vb.net
}
Dim blue As Color = pal.GetColor(0, 0, 255){code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle