Gathering detailed insights and metrics for ngx-color-picker
Gathering detailed insights and metrics for ngx-color-picker
Gathering detailed insights and metrics for ngx-color-picker
Gathering detailed insights and metrics for ngx-color-picker
Color picker widget for the Angular (version 2 and newer)
npm install ngx-color-picker
Maintenance release 17.0.0
Published on 07 Jul 2024
Maintenance release 16.0.0
Published on 26 Nov 2023
Maintenance release 15.0.0
Published on 20 Sept 2023
Maintenance release
Published on 26 Feb 2023
Maintenance release
Published on 02 Oct 2022
Bug fix release
Published on 06 Mar 2022
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
457 Stars
368 Commits
143 Forks
20 Watching
14 Branches
34 Contributors
Updated on 15 Nov 2024
Minified
Minified + Gzipped
TypeScript (49.99%)
HTML (27.52%)
CSS (22.36%)
JavaScript (0.14%)
Cumulative downloads
Total Downloads
Last day
1.3%
34,366
Compared to previous day
Last week
5.5%
172,161
Compared to previous week
Last month
7.2%
717,038
Compared to previous month
Last year
3.2%
7,682,034
Compared to previous year
1
3
This is a simple color picker based on the cool angular2-color-picker by Alberplz.
This documentation is for the latest version which requires Angular 5 or newer. For Angular 4 you need to use the latest 4.x.x version. Documentation for the 4.x.x can be found from here.
Example application | StackBlitz example
1npm install 2npm run build
1npm install 2npm run start
1npm install ngx-color-picker --save
1import { ColorPickerModule } from 'ngx-color-picker'; 2 3@NgModule({ 4 ... 5 imports: [ 6 ... 7 ColorPickerModule 8 ] 9})
1<input [(colorPicker)]="color" [style.background]="color"/>
1[colorPicker] // The color to show in the color picker dialog. 2 3[cpWidth] // Use this option to set color picker dialog width ('230px'). 4[cpHeight] // Use this option to force color picker dialog height ('auto'). 5 6[cpToggle] // Sets the default open / close state of the color picker (false). 7[cpDisabled] // Disables opening of the color picker dialog via toggle / events. 8 9[cpColorMode] // Dialog color mode: 'color', 'grayscale', 'presets' ('color'). 10 11[cpCmykEnabled] // Enables CMYK input format and color change event (false). 12 13[cpOutputFormat] // Output color format: 'auto', 'hex', 'rgba', 'hsla' ('auto'). 14[cpAlphaChannel] // Alpha mode: 'enabled', 'disabled', 'always', 'forced' ('enabled'). 15 16[cpFallbackColor] // Used when the color is not well-formed or is undefined ('#000'). 17 18[cpPosition] // Dialog position: 'auto', 'top', 'bottom', 'left', 'right', 19 // 'top-left', 'top-right', 'bottom-left', 'bottom-right' ('auto'). 20[cpPositionOffset] // Dialog offset percentage relative to the directive element (0%). 21[cpPositionRelativeToArrow] // Dialog position is calculated relative to dialog arrow (false). 22 23[cpPresetLabel] // Label text for the preset colors if any provided ('Preset colors'). 24[cpPresetColors] // Array of preset colors to show in the color picker dialog ([]). 25 26[cpDisableInput] // Disables / hides the color input field from the dialog (false). 27 28[cpDialogDisplay] // Dialog positioning mode: 'popup', 'inline' ('popup'). 29 // popup: dialog is shown as popup (fixed positioning). 30 // inline: dialog is shown permanently (static positioning). 31 32[cpIgnoredElements] // Array of HTML elements that will be ignored when clicked ([]). 33 34[cpSaveClickOutside] // Save currently selected color when user clicks outside (true). 35[cpCloseClickOutside] // Close the color picker dialog when user clicks outside (true). 36 37[cpOKButton] // Show an OK / Apply button which saves the color (false). 38[cpOKButtonText] // Button label text shown inside the OK / Apply button ('OK'). 39[cpOKButtonClass] // Additional class for customizing the OK / Apply button (''). 40 41[cpCancelButton] // Show a Cancel / Reset button which resets the color (false). 42[cpCancelButtonText] // Button label text shown inside the Cancel / Reset button ('Cancel'). 43[cpCancelButtonClass] // Additional class for customizing the Cancel / Reset button (''). 44 45[cpAddColorButton] // Show an Add Color button which add the color into preset (false). 46[cpAddColorButtonText] // Button label text shown inside the Add Color button ('Add color'). 47[cpAddColorButtonClass] // Additional class for customizing the Add Color button (''). 48 49[cpRemoveColorButtonClass] // Additional class for customizing the Remove Color button (''). 50 51[cpPresetColorsClass] // Additional class for customizing the Preset Colors container (''). 52 53[cpMaxPresetColorsLength] // Use this option to set the max colors allowed in presets (null). 54 55[cpPresetEmptyMessage] // Message for empty colors if any provided used ('No colors added'). 56[cpPresetEmptyMessageClass] // Additional class for customizing the empty colors message (''). 57 58[cpUseRootViewContainer] // Create dialog component in the root view container (false). 59 // Note: The root component needs to have public viewContainerRef. 60 61(colorPickerOpen) // Current color value, send when dialog is opened (value: string). 62(colorPickerClose) // Current color value, send when dialog is closed (value: string). 63 64(colorPickerChange) // Changed color value, send when color is changed (value: string). 65(colorPickerCancel) // Color select canceled, send when Cancel button is pressed (void). 66(colorPickerSelect) // Selected color value, send when OK button is pressed (value: string). 67 68(cpToggleChange) // Status of the dialog, send when dialog is opened / closed (open: boolean). 69 70(cpInputChange) // Input name and its value, send when user changes color through inputs 71 // ({input: string, value: number | string, color: string}) 72 73(cpSliderChange) // Slider name and its value, send when user changes color through slider 74 // ({slider: string, value: number | string, color: string}) 75(cpSliderDragStart) // Slider name and current color, send when slider dragging starts (mousedown,touchstart) 76 // ({slider: string, color: string}) 77(cpSliderDragEnd) // Slider name and current color, send when slider dragging ends (mouseup,touchend) 78 // ({slider: string, color: string}) 79 80(cpCmykColorChange) // Outputs the color as CMYK string if CMYK is enabled (value: string). 81 82(cpPresetColorsChange) // Preset colors, send when 'Add Color' button is pressed (value: array).
1openDialog() // Opens the color picker dialog if not already open. 2closeDialog() // Closes the color picker dialog if not already closed.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 13/30 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
17 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More