A beautiful color picker for angular that let you choose from a color palette, using sliders (Hue, Lightness, Alpha sliders) or through text input(hex, rgba, hsla)
Angular > v10.0.0 < 13.1.1
Angular > v13.1.1
npm install ngx-colors
import { NgxColorsModule } from 'ngx-colors';
@NgModule({
...
imports: [
...
NgxColorsModule
]
})
This library is composed of two parts:
- ngx-colors-trigger: This directive can be applied to any html element turning it into a trigger that when clicked will open the color picker
- ngx-colors: This component is a premade button that will display the selected color.
<ngx-colors ngx-colors-trigger [(ngModel)]="color"></ngx-colors>
<form class="example-form">
<ngx-colors
ngx-colors-trigger
style="display: inline-block; margin:5px;"
[formControl]="colorFormControl"
></ngx-colors>
</form>