New to Kendo UI for Angular? Start a free 30-day trial

ColorPicker Customization

The ColorPicker allows you to customize the following building blocks:

Views Toggle Buttons

When both the Gradient and Palette view are present, the user can toggle between them through the view buttons rendered in the header of the ColorPicker popup. The order of the buttons will be determined by the order specified in the views array.

If only a single view is specified, the view toggle buttons will not be rendered.

The following example demonstrates the toggle buttons in action.

Example
View Source
Edit In Stackblitz  
Change Theme:

Clear Button

The ColorPicker provides an option to display a clear button, through the clearButton property. It allows the user to clear the current ColorPicker value.

The following example demonstrates the clear button.

Example
View Source
Edit In Stackblitz  
Change Theme:

Action Buttons Layout

When the preview option of the ColorPicker is enabled, it will display the Apply and Cancel action buttons in its footer. The layout of the buttons can be customized through the actionsLayout property.

The following example demonstrates how to customize the layout of the action buttons.

Example
View Source
Edit In Stackblitz  
Change Theme:

Palette View

To change the appearance in the popup when the ColorPicker displays its palette view, utilize its paletteSettings option.

The paletteSettings interface exposes the following options:

  • columnsSpecifies the number of columns in the palette table. By default, the table has 10 columns.

  • paletteDetermines the set of colors that will be visualized in the palette itself. The possible values are an array or a comma-separated string with colors, or the name of one of the predefined palette color presets.

  • tileSizeDetermines the size of each colored tile (rectangle) in the palette table. The following values are allowed:

    • numberWill be applied to both the width and the height of the tile.
    • TileSize configuration objectAllows you to specify the width and height values individually.

The following example demonstrates the palette settings in action.

Example
View Source
Edit In Stackblitz  
Change Theme:

Gradient View

To change the appearance in the popup when the ColorPicker displays its gradient view, utilize its gradientSettings option.

The gradientSettings interface exposes the following options:

  • contrastToolProvides an option for displaying a contrast tool. It ensures the user that the selected color meets certain contrast requirements e.g. AA or AAA.
  • opacityDetermines whether the popup will display an opacity (alpha) slider. Currently, when the opacity slider is enabled, you can use only an rgba output format.
  • delayDetermines the delay time (in milliseconds) before the value is changed on handle drag.

The following example demonstrates the gradient settings in action.

Example
View Source
Edit In Stackblitz  
Change Theme:

Displaying Icons

You can enhance the visual appearance of the ColorPicker by displaying an icon to the left side of its button. In this case the selected color will be displayed right below the icon which allows you to bring visual context about the purpose of the selected color.

To display an icon, use either of the following options:

  • iconAllows you to use a built-in Kendo UI icon by providing its name, for example, edit-tool. The icon will be automatically rendered in a span element with the corresponding CSS classes.
  • iconClassAllows you to use custom icons by providing the full icon CSS classes which will be rendered.

The following example demonstrates how to visualize Kendo UI and custom icons in the ColorPicker.

Example
View Source
Edit In Stackblitz  
Change Theme: