![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
color-grabber
Advanced tools
This Angular Directive changes the background color of its container to the average color of the provided image - also adjusts the color to white or black based on that color
This Angular Directive when applied to a div will get the average color of the provided url of an image and then change the background color to that color. Any test inside the div will be colored white or black based on the average color of the image that best suites it.
npm install color-grabber
Import the module into your project under imports
imports: [
BrowserModule,
AppRoutingModule,
ColorGrabberModule
],
In the following example, the mat-card contaner has the colorGrab
directive applied.
The [imageUrl]="image"
is the image to grab the color from.
The [light]="'#FFFFFF'"
is the light color to use if the average color is dark.
The [dark]="'#000000'"
is the dark color to use if the average color is light.
The mat-card contaner background color will change to this color
The Text inside this container will also change ether to black or white depending what suites best based on that colors image.
To use in the directive, use the following
image = "https://picsum.photos/id/1/5616/3744"
<mat-card style="margin: 8px;"
colorGrab [imageUrl]="image" [light]="'rgb(220, 220, 220)'" [dark]="'rgb(47, 79, 79)'"
class="box"
>
<h3>{{ item.author }}</h3>
<img [src]="image" width="160" height="120" style="object-fit: cover;">
</mat-card>
imageUrl - provide the full URL of the image (png, jpg)
colorGrab [imageUrl]="item.download_url"
FAQs
This Angular Directive changes the background color of its container to the average color of the provided image - also adjusts the color to white or black based on that color
The npm package color-grabber receives a total of 0 weekly downloads. As such, color-grabber popularity was classified as not popular.
We found that color-grabber 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.