Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
gradient.js
Advanced tools
Readme
Create colorful gradient arrays in a single line of code.
Download the Github repo or run:
npm i gradient.js
const { Gradient } = require("gradient.js");
Gradient.create(
100,
"rgb(255, 209, 209)",
"#FBFFDE",
"#D7FDDF",
"#E0FFFD",
"hsl(240, 96%, 91%)",
"#F9DEFF"
);
(an image created using canvas and data from the above array)
Gradient.create(resolution, ...colors);
Gradient.create()
takes in a resolution, which determines how many colors to create in between each provided color. It is always the first argument. It is followed by the colors you want the gradient to move between. An unlimited number of colors, in any (CSS) accepted format can be used. An array of rgba(r, g, b, a);
colors are returned.
Gradient.colorKeyMap
Gradient.colorKeyMap
is an array of every CSS color name and its corrosponding RGBA value.
black: [0, 0, 0, 1],
silver: [192, 192, 192, 1],
Gradient.convertToRGBA(color)
Gradient.convertToRGBA()
takes in any CSS accepted color and turns it into an RGBA array.
[r, g, b, a]
Gradient.rgbaStyler(rgba)
Gradient.rgbaStyler()
creates a formatted CSS-compatible string from an array.
i.e.: [0, 0, 0, 0]
becomes "rgba(0, 0, 0, 0)"
.
FAQs
Create colorful gradient arrays in a single line of code.
The npm package gradient.js receives a total of 1 weekly downloads. As such, gradient.js popularity was classified as not popular.
We found that gradient.js 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.