A simple color picker for angular versions 4 - 6.
- Simple and intuitive interface.
- High performance.
- Minimum of dependencies.
- Color palettes.
##Demo Demo playground
##Installing and usage
You can get it on npm.
####NPM
$ npm install --save ngx-ttitan-color-picker
import {NgxTTitanColorPickerModule} from "ngx-ttitan-color-picker";
@NgModule({
imports: [
...,
NgxTTitanColorPickerModule
],
})
export class AppModule { }
<lib-ngx-ttitan-color-picker
[options]="{
outFormat: 'hex8',
inputFormat: 'hex8'
}"
[color]="color"
(change)="colorChange($event)"
></lib-ngx-ttitan-color-picker>
Param | Type | Default | Description |
---|---|---|---|
color |
string | '#ffffff' |
Input color. Two-way binding param |
title |
string | '' |
Picker input label |
options |
PickerOptions | '{}' |
Picker configuration |
Param | Type | Default | Description |
---|---|---|---|
pickerShow |
boolean | false |
Display color picker on start |
noHide |
boolean | false |
Do not hide the picker |
debug |
boolean | false |
Debug output |
outFormat |
string | 'hex6' |
Output color format |
inputFormat |
string | 'hex6' |
Expected color format in input field |
availPallets |
string[] | ['polaris', 'material'] |
List of color palettes. Set empty array for hide color pallets |
customPallets |
Palette[] | '[]' |
Custom pallets list |
Param | Type | Default | Description |
---|---|---|---|
name |
string | false |
Display palette name |
id |
string | false |
Palette id. Must be unique. |
colors |
string[] | false |
List of colors |
Param | Type | Description |
---|---|---|
colorChange |
EventEmmiter<string> |
Output color |
This is my first public module for Angular. So do not judge strictly ;)
- Fixed rgba && hsla alpha bug
- Added style for color pallets
- Fixed hex8 alpha