Color picker (ngx-color-palette)
Angular library which provides color picker functionality to your angular application.
A color picker is a graphical user interface widget, usually found within graphics software or online, used to select colors and, in some cases, to create color schemes.
Import
Import the module on your app.module.ts
file as follow.
import { NgxColorPaletteModule } from 'ngx-color-palette';
Then import the module as follow on imports array
NgxColorPaletteModule
Integration
<ngx-color-palette [color]="'red'" (currentColor)="currentColor($event)"></ngx-color-palette>
on .html
<ngx-color-palette [color]="color" [squared]="false" (currentColor)="currentColor($event)"></ngx-color-palette>
on .ts
color = '#FBC02D';
public currentColor(event: any) {
this.color = event.color;
}
Field | type | Info |
---|
color | string | Variable to bind |
squared | boolean | Non-rounded egdes |
currentColor | event / method | to get changed / emitted value |
Code integration
To use this package as a service npm i ngx-color-palette
install this on the root angular project .
Note: Don't forget to run this commend npm i ngx-color-palette
on root folder or else it will throw error.