Back to Devexpress

Palette.Add(Color) Method

corelibraries-devexpress-dot-xtracharts-dot-palette-dot-add-x28-system-dot-drawing-dot-color-x29.md

latest3.2 KB
Original Source

Palette.Add(Color) Method

Appends a new palette entry with the specified color to the current palette.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public int Add(
    Color color
)
vb
Public Function Add(
    color As Color
) As Integer

Parameters

NameTypeDescription
colorColor

A Color object that specifies the first and second colors of the palette entry. This value is assigned to the PaletteEntry.Color property.

|

Returns

TypeDescription
Int32

An integer value indicating the position at which the new element was inserted.

|

Remarks

This method creates a new PaletteEntry object, initializes it with the specified values and adds it to the end of the collection.

Note : In this case the PaletteEntry.Color2 property will also be set to the specified color.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(Color) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/Heatmap/HeatmapItemControlProvider.cs#L151

csharp
foreach(Color color in colors)
    palette.Add(color);
return palette;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/Heatmap/HeatmapItemControlProvider.vb#L159

vb
For Each color As Color In colors
    palette.Add(color)
Next color

See Also

Palette Class

Palette Members

DevExpress.XtraCharts Namespace