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

Replaces the color at the specified index in the palette with a new color.

Signature
C#
C#
 public Color SetColorAt(int index, int red, int green, int blue)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function SetColorAt(ByVal index As Integer, ByVal red As Integer, ByVal green As Integer, ByVal blue As Integer) As Color
{signature}
{parameters}
{param:index}The 0\-based index of the color to modify. Must be between 0 and 55.{param}
{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 new color at the specified index in the palette.{returns}
{exceptions}
{exception:System.ArgumentOutOfRangeException}If the given red, green, or blue value is not between 0 and 255.{exception}
{remarks}
Any objects that reference this palette color will be updated to use the new RGB values instead. For .xlsx files, this will modify the legacy palette, which is used when opening the file in Excel 2003.
{remarks}
{example}{code:csharp|title=C#}
Parameters
Param
index
index

The 0-based index of the color to modify. Must be between 0 and 55.

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 new color at the specified index in the palette.

Exceptions
Exception
System.ArgumentOutOfRangeException
System.ArgumentOutOfRangeException

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

Remarks

Any objects that reference this palette color will be updated to use the new RGB values instead. For .xlsx files, this will modify the legacy palette, which is used when opening the file in Excel 2003.

Example
Code Block
csharp
csharp
titleC#

pal.SetColorAt(4, 162, 221, 138);
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

pal.SetColorAt(4, 162, 221, 138)
{code} {example}