1.0.3 • Published 12 months ago

input-color-picker v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

InputColorPicker Angular Library.

A library of color pickers in input format.

You can check out the demo here.

Excute

Installation

npm install --save input-color-picker

Usage

Import into your @NgModule.

import { NgModule } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { InputColorPickerModule } from 'input-color-picker'

@NgModule({

  imports: [

    FormsModule,
    InputColorPickerModule
  ],
  declarations: []
})
export class MyModule {}

Then, using your component.

@Component( {

  selector: 'app',
  template: '<input-color-picker [(ngModel)]="color" [col]="40" [boxHeight]="48" [colorWidth]="20" [colorHeight]="20" [placeholder]="\'Color selection\'"></input-color-picker>'
} )
export class AppComponent {

  public color: string

  /* Optional */
  this.palette = [ { code: '#ffffff', name: 'White' } ... ]
}

Parameter

NameTypeDescriptionDefault
colnumberNumber of colors to include in one line40
palettearray { "code": "#ffffff", "name": "White" } ... If you set a value, the palette will change to that value.
boxHeightnumberBox height (px)48
colorWidthnumberColor width (px)20
colorHeightnumberColor height (px)20
placeholderstringPlaceholder before color selection'Color selection'

Change Log

1.0.0 : Initial release. 1.0.2 : Remove package dependency.

License

MIT

Other programs

https://bettep.org