ColorEditItemCollection.Add(Color) Method
In This Article
Creates a new item with the specified color and adds it to the collection.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public ColorEditItem Add(
Color colorValue
)
#Parameters
Name | Type | Description |
---|---|---|
color |
Color | A Color value that specifies the color of the item. This value is assigned to the Color |
#Returns
Type | Description |
---|---|
Color |
A Color |
#Example
This example demonstrates how to customize the ASPxColorEditor Items collection. The image below shows the result.
using System.Drawing;
protected void Page_Load(object sender, EventArgs e) {
Color color = Color.Empty;
// Create a green palette that contains 24 color items
for (int i = 0; i < 24; i++) {
color = Color.FromArgb(0, i * 256 / 24, 0);
ceGreenPalette.Items.Add(color);
}
}
See Also