0.0.17 • Published 11 months ago

ngx-prime-color-picker v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Welcome to ngx-prime-color-picker!

Our tool offers a vast palette of hues at your fingertips. Easily select the perfect color for your designs with precise controls and intuitive interface.

This package is designed to work exclusively with Angular standalone components. Please ensure your project is configured accordingly.

npm i ngx-prime-color-picker

ngx-prime-color-picker npm version npm.io

Precise color selection, effortlessly.

Our tool offers a vast palette of hues at your fingertips. Easily select the perfect color for your designs with precise controls and intuitive interface.



Import

Import the module on your app.module.ts file as follow.

<ngx-prime-color-picker
  [color]="color"
  (getCurrentColorObject)="currentColorObject($event)"

  [showConversionTable]="true"
  [showLightness]="true"
  [showColorPalette]="true"
  [showGradient]="true"
  [showSaturation]="true"
></ngx-prime-color-picker>

On Your component file (TS)

import { NgxPrimeColorPickerComponent, COLOROBJECT } from "ngx-prime-color-picker";

@Component({
  selector: '...',
  standalone: true,
  imports: [NgxPrimeColorPickerComponent],
  templateUrl: '...',
  styleUrl: '...'
})
export class YourComponent {

  public color = '#ff9800';

  public currentColorObject(event: COLOROBJECT) {
    console.log('event: ', event);
  }
  // Sample output
  // {
  //   "red": 234,
  //   "green": 155,
  //   "blue": 36,
  //   "hue": 36,
  //   "sat": 0.82,
  //   "lightness": 0.53,
  //   "whiteness": 0.14,
  //   "blackness": 0.08,
  //   "cyan": 0,
  //   "magenta": 0.34,
  //   "yellow": 0.85,
  //   "black": 0.08,
  //   "ncol": "R60",
  //   "opacity": 1,
  //   "valid": true,
  //   "hex": "#ea9b24"
  // }

}
Bind VariableUsageDefault
colorCurrent color / Choosed Color'#ff0000'
showConversionTableEnables Color conversion tablefalse
showColorPaletteEnables Exteneded Color Palettesfalse
showLightnessEnables Lightness sliderfalse
showSaturationEnables Saturation sliderfalse

Bind MethodUsage
getCurrentColorObject($event)Get changed color object

Code integration

To use this package as a service npm i ngx-prime-color-picker install this on the root angular project .

Note: Don't forget to run this commend npm i ngx-prime-color-picker on root folder or else it will throw error.