1.0.1 • Published 6 years ago

ngx-simple-colorpicker v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Ngx Simple Colorpicker

Description

This is a really simple colorpicker library for Angular 2+

npm.io

Installation

npm i ngx-simple-colorpicker

Usage

Load the library

import { ColorPickerModule } from 'ngx-simple-colorpicker';
@NgModule({
  ...
  imports: [
    ...
    ColorPickerModule
  ]
})

Use it in your HTML

<color-picker
   [colors]="['#c62828', '#6a1b9a', '#283593', '#0277bd', '#00695c', '#558b2f', '#ef6c00', '#6d4c41', '#546e7a']"
   (selectColor)="changeColorAction($event)"></color-picker>

API

Inputs

@Input()TypeDefaultDetails
currentColorstring''The selected color
colorsArray[]Sample colors

Outputs

@Output()ValueDetails
selectColorstringEmit when the user select a new color in the tooltip. The selected color is emitted

Development

Building the library

npm i
npm start

Library development

npm run packagr