ColorEditItemCollection.Add(Color) Method
Creates a new item with the specified color and adds it to the collection.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
NuGet Package: DevExpress.Web
Declaration
Parameters
Name | Type | Description |
---|---|---|
colorValue | Color | A Color value that specifies the color of the item. This value is assigned to the ColorEditItem.Color property. |
Returns
Type | Description |
---|---|
ColorEditItem | A ColorEditItem object that is the newly created item. |
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