ColorPicker
import { ColorPickerModule } from '@anguless/angulux/colorpicker';Basic
The picker opens in an overlay and binds to a hex string.
<agl-colorPicker [(ngModel)]="colour" /><span>{{ colour }}</span>Inline
An inline picker is always visible instead of opening in an overlay.
<agl-colorPicker [(ngModel)]="colour" [inline]="true" />Format
Format switches the bound value between hex, rgb and hsb.
<agl-colorPicker [(ngModel)]="colour" format="rgb" /><span>{{ colour | json }}</span>API
Generated from the committed corpus, which check:corpus holds to the built library.
ColorPicker
componentagl-colorPicker, agl-colorpicker, agl-color-pickerColorPicker is an input to choose a colour, in a popup panel or inline. Keyboard: on the input, Space opens or closes the panel, ArrowDown opens it and then moves into it, and Escape or Tab closes it. The colour area is a slider: ArrowLeft and ArrowRight set the saturation, ArrowUp and ArrowDown the brightness, by 1 or by 10 with Shift. The hue bar is a vertical slider: the arrow keys move the hue by 1, or by 10 with Shift, and Home and End go to 0 and 360. In the popup panel, Tab goes between the two, and Escape closes it with focus back on the input.
| Input | Type | Default | Description |
|---|---|---|---|
| style deprecated — since v20.0.0, use `class` instead. | string | undefined | not documented | Style class of the component. |
| show deprecated — since v21.0.0, use `motionOptions` instead. | string | not documented | Transition options of the show animation. |
| hide deprecated — since v21.0.0, use `motionOptions` instead. | string | not documented | Transition options of the hide animation. |
| inline | boolean | undefined | not documented | Whether to display as an overlay or not. |
| format | 'hex' | 'rgb' | 'hsb' | not documented | Format to use in value binding. |
| tabindex | string | undefined | not documented | Index of the element in tabbing order. |
| input | string | undefined | not documented | Identifier of the focus input to match a label defined for the dropdown. |
| auto | boolean | not documented | Whether to automatically manage layering. |
| autofocus | boolean | undefined | not documented | When present, it specifies that the component should automatically get focus on load. |
| default | string | undefined | not documented | Default color to display initially when model value is not present. |
| append | HTMLElement | ElementRef | TemplateRef<any> | 'self' | 'body' | null | undefined | any | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| overlay | OverlayOptions | undefined | not documented | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
| motion | MotionOptions | undefined | not documented | The motion options. |
| Output | Type | Description |
|---|---|---|
| on | EventEmitter<ColorPickerChangeEvent> | Callback to invoke on value change. |
| on | EventEmitter<any> | Callback to invoke on panel is shown. |
| on | EventEmitter<any> | Callback to invoke on panel is hidden. |
Inherited from BaseEditableHolder
inherited| Input | Type | Default | Description |
|---|---|---|---|
| required | false | There must be a value (if set). Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` is required when that control carries `Validators.required` or `Validators.requiredTrue`. | |
| invalid | false | When present, it specifies that the component should have invalid state style. Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` shows the state of that control once it is touched or dirty. | |
| touched | boolean | undefined | undefined | Whether the user has visited the control. Once this or `dirty` is set, the invalid state style waits for interaction: it appears when the control is touched or dirty. Signal Forms' `[formField]` sets both, so an untouched required field is not shown as invalid. Leave both unset and `invalid` alone decides. |
| dirty | boolean | undefined | undefined | Whether the user has changed the value. See `touched`. |
| disabled | false | When present, it specifies that the component should have disabled state style. | |
| name | string | undefined | undefined | When present, it specifies that the name of the input. |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | undefined | undefined | Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |