New to Kendo UI for AngularStart a free 30-day trial

Represents the Kendo UI ColorPicker component for Angular.

The ColorPickerComponent is a tool for choosing colors from Gradient and Palette views rendered in its popup. You can preview the selected color, revert it to its previous state, or clear it.

Definition

Package:@progress/kendo-angular-inputs

Selector:kendo-colorpicker

Export Name:Accessible in templates as #kendoColorPickerInstance="kendoColorPicker"

Syntax:

html
<kendo-colorpicker [(value)]="selectedColor"></kendo-colorpicker>

Inputs

Configures the layout of the Apply and Cancel action buttons.

Default:

'end'

Sets the initially active view in the popup. Supports two-way binding.

Enables or disables the adaptive mode. By default, adaptive rendering is disabled.

Default:

'none'

Sets the subtitle of the ActionSheet rendered instead of the Popup on small screens. By default, the ActionSheet does not render a subtitle.

Sets the title of the ActionSheet rendered instead of the Popup on small screens.

Default:

''

Specifies whether the ColorPicker displays a Clear color button.

Default:

true

disabled

boolean

Sets the disabled state of the ColorPicker. To disable it in reactive forms, see Forms Support.

Default:

false

The fillMode property specifies the background and border styles of the ColorPicker (see example). The default value is set by the Kendo theme.

Specifies the output format of the ColorPicker.

If the input value is in a different format, the component parses it into the specified output format.

Default:

'rgba'

Configures the gradient displayed in the ColorPicker popup.

icon

string

Defines the name of an existing icon in the Kendo UI theme. Provide only the name of the icon without the k-icon or k-i- prefixes.

iconClass

string | string[] | { [key: string]: boolean }

A CSS class name which displays an icon in the ColorPicker button. iconClass is compatible with the ngClass syntax.

Takes precedence over icon if both are defined.

Configures the palette displayed in the ColorPicker popup.

Configures the popup of the ColorPicker.

preview

boolean

Displays Apply and Cancel action buttons and color preview panes.

When enabled, the component value does not change immediately upon color selection, but only after the Apply button is clicked.

The Cancel button reverts the current selection to its previous state, i.e., to the current value.

Default:

false

readonly

boolean

Sets the read-only state of the ColorPicker.

Default:

false

The rounded property specifies the border radius of the ColorPicker (see example). The default value is set by the Kendo theme.

The size property specifies the padding of the ColorPicker internal elements (see example). The default value is set by the Kendo theme.

svgIcon

SVGIcon

Defines an SVGIcon to render within the button. The input can take either an existing Kendo SVG icon or a custom one.

tabindex

number

Sets the tabindex of the component.

Default:

0

value

string

Sets the value of the selected color.

Specifies the views rendered in the popup. By default, both the gradient and palette views are rendered.

Fields

container

ViewContainerRef

Provides a reference to a container element inside the component markup. The container element references the location of the appended popup— for example, inside the component markup.

isFocused

boolean

Indicates whether the ColorPicker wrapper is focused.

Default:

false

isOpen

boolean

Returns the current open state. Returns true if the Popup (or ActionSheet in adaptive mode) is currently open.

Events

Fires when the left side of the ColorPicker wrapper is clicked. The event is triggered regardless of whether a ColorPicker icon is set or not.

The ActiveColorClickEvent event provides the option to prevent the popup opening.

Fires when the view is about to change. Used to provide a two-way binding for the activeView property.

Fires when the ColorPicker is blurred.

Fires when the user cancels the current color selection.

Fires on preview pane or 'Cancel' button click.

Fires when the Popup (or ActionSheet in adaptive mode) is about to close. This event is preventable. If you cancel it, the Popup (or the ActionSheet) remains open.

Fires when the ColorPicker is focused.

Fires when the Popup (or ActionSheet in adaptive mode) is about to open. This event is preventable. If you cancel it, the Popup (or the ActionSheet) remains closed.

Fires when the value changes.

Methods

Blurs the ColorPicker.

Focuses the wrapper of the ColorPicker.

Clears the value of the ColorPicker.

Toggles the Popup (or ActionSheet in adaptive mode) of the ColorPicker. Does not trigger the open and close events of the component.

Parameters:open?boolean

An optional parameter. Specifies whether the popup will be opened or closed.