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 the closest color to the specified color that the file can support.

Signature
C#
C#
 public Color GetClosestColor(System.Drawing.Color color)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function GetClosestColor(ByVal color As System.Drawing.Color) As Color
{signature}
{parameters}
{param:color}The desired color.{param}
{returns}The closest color in the palette to the specified RGB value{returns}
{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 color exactly.
{remarks}
{example}{code:csharp|title=C#}
Parameters
Param
color
color

The desired color.

Returns

The closest color in the palette to the specified RGB value

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 color exactly.

Example
Code Block
csharp
csharp
titleC#

Color clr = pal.GetClosestColor(System.Drawing.Color.Red);
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

Dim clr As Color = pal.GetClosestColor(System.Drawing.Color.Red)
{code} {example}