
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
color-selection
Advanced tools
This Angular Module (Component) that adds the UI for Color Selection.
npm install color-selection
Import the module into your project under imports
imports: [
BrowserModule,
AppRoutingModule,
ColorSelectionModule
],
or
imports: [
BrowserModule,
AppRoutingModule,
ColorSelectionModule.forRoot({
colors: [
{ name: 'blue0', hex: '#FFAA00'},
{ name: 'blue1', hex: '#FFAA11'},
{ name: 'blue2', hex: '#FFAA22'},
{ name: 'blue3', hex: '#FFAA33'},
{ name: 'blue4', hex: '#FFAA44'}
]
}),
],
To use in your component, use the following tag
<wav-color-selection></wav-color-selection>
colors: Encrypt the input using the token ARRAY OF COLORS (Object)
colorName: Allows the user to view the encrypted string BOOLEAN
Array of color values
colors = [
{ name: 'blue0', hex: '#FFAA00'},
{ name: 'blue1', hex: '#FFAA11'},
{ name: 'blue2', hex: '#FFAA22'},
{ name: 'blue3', hex: '#FFAA33'},
{ name: 'blue4', hex: '#FFAA44'}
]
Create an Array of your colors using the Color Model
{ name: "blue2", hex: "#FFAA44" }
<wav-color-selection
[colors]="colors"
[colorName]="true"
formControlName="color"
></wav-color-selection>
Here is the same component inside a formGroup
<div [formGroup]="colorsForm" style="padding: 24px;">
<wav-color-selection
[colors]="colors"
[colorName]="true"
formControlName="color"
></wav-color-selection>
</div>
You will note that the control will return an string of the color value If colorName input is set to TRUE, then you will get the Name of the color otherwise you will get the Hex value
Below is a sample of the implementation
colorsForm = this.fb.group({
color: ['Black']
})
colors = [
{ name: 'Black', hex: '#000000'},
{ name: 'Fresh Lilac', hex: '#8D5A97'},
{ name: 'Mountainbatten Pink', hex: '#907F9F'},
{ name: 'WhiSilver Metalic', hex: '#A4A5AE'},
{ name: 'Opal', hex: '#B0C7BD'},
{ name: 'Magic Mint', hex: '#B8EBD0'},
]
ngOnInit() {
this.colorsForm.get('color')?.valueChanges.subscribe(data => {
console.log('value:', data)
})
}
FAQs
This Angular Module (Component) that adds the UI for Color Selection.
The npm package color-selection receives a total of 1 weekly downloads. As such, color-selection popularity was classified as not popular.
We found that color-selection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.