Angular2 Color Picker Save

Angular 2 Color Picker Directive, no dependences required.

Project README


Angular 2 Color Picker Directive/Component with no dependencies required.
This is a Color Picker Directive/Component for Angular 2.

Demo page


npm i --save angular2-color-picker


  • Use it in your HTML elements, for example:
<input [(colorPicker)]="color" [style.background]="color" [value]="color"/>
  • Or:
<input [colorPicker]="color" (colorPickerChange)="color=$event" [style.background]="color" [value]="color"/>
  • Add ColorPickerModule in your app.module.ts:
import {ColorPickerModule} from 'angular2-color-picker';

    imports: [ColorPickerModule]

  • Set color the variable. You can use ColorPickerService in your component if you want extra functions.
import {Component} from '@angular/core';
import {ColorPickerService} from 'angular2-color-picker';

    selector: 'my-app',
    templateUrl: 'app/demo.html'

export class AppComponent {
    private color: string = "#127bdc";
    constructor(private cpService: ColorPickerService) {
  • Configure system.config.js
var map = {
        'angular2-color-picker': 'node_modules/angular2-color-picker'
var packages = {
        'angular2-color-picker': {main:'index.js', defaultExtension: 'js'}


git clone
npm install
cd agular2-color-picker
npm run build
gulp copylib

#Options Default option is the first item.

[cpOutputFormat]="'hex', 'rgba', 'hsla'"
[cpPosition]="'right', 'left', 'top', 'bottom'"
[cpPositionRelativeToArrow]="false, true"
[cpSaveClickOutside]="true, false"
[cpOKButton]="false, true"
[cpCancelButton]="false, true"
[cpPresetLabel]="'Preset colors'"
[cpPresetColors]="[]", e.g: "['#fff', '#000']"
[cpToggle] = "false, true"
[cpDialogDisplay]="'popup,' 'inline'"
[cpAlphaChannel]="'hex6', 'hex8', 'disabled'"

#Extra content If you want to change precalculated images for color picker sliders, you can find a little script in this project:

#Tested in:

  • Chrome
  • Firefox
  • Microsoft Edge
  • Opera
  • Safari
  • Internet Explorer

#For previous version of Angular:

Open Source Agenda is not affiliated with "Angular2 Color Picker" Project. README Source: Alberplz/angular2-color-picker
Open Issues
Last Commit
5 years ago

Open Source Agenda Badge

Open Source Agenda Rating