New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
Palettes
Updated over 6 months ago
The ColorPicker supports color palettes that are displayed in the Palette view.
The default palette consists of 20 basic colors. You can specify the desired collection of colors through the Palette() option.
The example below demonstrates how to define a color palette that will be displayed in the Palette view.
Razor
@(Html.Kendo().ColorPicker()
.Name("colorPicker")
.Palette(new string[] { "#ddd1c3", "#d2d2d2", "#746153", "#3a4c8b", "#ffcc33", "#fb455f", "#ac120f" })
)
Defining Web-Safe Colors
The ColorPicker provides a color palette of Web-safe colors. Use the ColorPickerPalette.WebSafe enum to define it.
Razor
@(Html.Kendo().ColorPicker()
.Name("colorPicker")
.Palette(ColorPickerPalette.WebSafe)
)
Specifying the Number of Columns
To specify the number of columns of the palette, set up the Columns() option. The number of columns is automatically configured when using the default or the WebSafe palettes.
Razor
@(Html.Kendo().ColorPicker()
.Name("colorPicker")
.Columns(3)
.Palette(new string[] { "#ddd1c3", "#d2d2d2", "#746153", "#3a4c8b", "#ffcc33", "#fb455f", "#ac120f" })
)