I want to create a color picker in ionic app [closed]

here is example for you

Credit for https://stackblitz.com/@bockoblur

import

import { ColorPickerModule } from 'ngx-color-picker';

@NgModule({
  bootstrap: [
    AppComponent
  ],
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ColorPickerModule
  ]
})

.html

<input 
      [style.background]="colorList[0].value" 
      [(colorPicker)]="colorList[0].value"
      [cpOKButton] = "true"
      [cpOKButtonText] = "'Select'"
      [cpCancelButton] = "true"
      [cpSaveClickOutside] = "'false'"
      [cpDisableInput]="false"
      [cpAlphaChannel]="'disabled'" 
      [cpOutputFormat]="'hex'"
      [cpPresetColors]="presetValues"
      [cpAddColorButton]="true" 
  />

Leave a Comment