Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

acrodata/color-picker

Open more actions menu

Repository files navigation

Color Picker

npm license

color-picker

Another beautiful color picker

Quick links

Documentation | Playground

Compatibility

Angular @acrodata/color-picker
>=17 1.x

Installation

npm install @acrodata/color-picker --save

Usage

import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ColorPicker } from '@acrodata/color-picker';

@Component({
  selector: 'your-app',
  template: `
    <color-picker [(ngModel)]="color" />
    <color-picker [(value)]="color" />
  `,
  imports: [FormsModule, ColorPicker],
})
export class YourAppComponent {
  color = '#ff0000';
}

API

Name Type Default Description
[value] string #000 The initial color string.
[format] ColorFormat undefined The output format of the color picker.
[hideAlpha] boolean false Whether to hide the alpha channel.
(valueChange) EventEmitter<string> - Event emitted when the value changes.
(formatChange) EventEmitter<ColorFormat> - Event emitted when the color format is changed.
(colorChange) EventEmitter<ColorChange> - Event emitted when the color changes.

CSS Variables

--cp-container-width
--cp-container-shape
--cp-container-padding
--cp-container-margin
--cp-container-elevation-shadow
--cp-container-background-color
--cp-container-text-color

--cp-input-shape
--cp-input-background-color
--cp-input-outline-color
--cp-input-hover-outline-color
--cp-input-focus-outline-color
--cp-input-text-font

--cp-icon-button-shape
--cp-icon-button-text-color
--cp-icon-button-background-color
--cp-icon-button-hover-background-color
--cp-icon-button-active-background-color
--cp-icon-button-focus-background-color
--cp-icon-button-focus-outline-color

--cp-saturation-picker-shape
--cp-saturation-picker-thumb-size
--cp-saturation-picker-thumb-shape
--cp-saturation-picker-thumb-shadow
--cp-saturation-picker-thumb-outline-color
--cp-saturation-picker-thumb-focus-outline-color

--cp-slider-width
--cp-slider-height
--cp-slider-shape
--cp-slider-thumb-width
--cp-slider-thumb-height
--cp-slider-thumb-shape
--cp-slider-thumb-background-color
--cp-slider-thumb-shadow
--cp-slider-thumb-outline-color
--cp-slider-thumb-focus-outline-color

License

MIT

Morty Proxy This is a proxified and sanitized view of the page, visit original site.