
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Gradientee is a tiny, self-contained library to create randomized gradient backgrounds based on triangles, squares or quadrilaterals. It is using Jake Archibald's seeded random function to get predictable results and avoid significant pattern changes on rerenders, for example during box resize
You can install package from npm:
bash npm install gradientee
or use CDN:
<script src="https://unpkg.com/gradientee@latest/dist/gradientee.min.js"></script>
Include script
<script type="text/javascript" src="https://unpkg.com/gradientee/dist/gradientee.min.js"></script>
and then use
<canvas id="canvas"></canvas>
const node = document.getElementById("canvas");
const ctx = node.getContext("2d");
const options = {
width: node.width,
height: node.height,
colorFrom: "#f00",
colorTo: "#ff0",
};
paintTriangles(ctx, options);
(experimental)
Due to experimental nature of Paint API that solution will work only for chrome-based browsers.
Please consult Can I Use for current browser state
Be advised to implement workarounds for other major browsers
To use CSS Houdini paint worklet, add module import into <script>
tags in header of your page
<script type="text/javascript">
CSS.paintWorklet.addModule("https://unpkg.com/gradientee/dist/gradientee-worklet.min.js");
</script>
and then use the css paint:
.selector-to-paint {
width: 1000px;
height: 400px;
background-image: paint(gradientee);
--gradientee-color-from: #00ff00;
--gradientee-color-to: #0000ff;
--gradientee-box-size: 60;
--gradientee-seed: 1234;
--gradientee-deflection-level: 20;
--gradientee-color-randomness: 0;
}
To control the canvas generator, use options js object
{
boxSize: 20,
colorFrom: "#fff",
colorTo: "#000",
colorRandomness: 0,
deflectionLevel: 20,
triangles: true,
seed: 1234
}
For CSS, all options have respective custom properties, formed by applying --gradientee
prefix to a kebab-case formatted option name
.selector-to-paint {
--gradientee-box-size: 20;
--gradientee-color-from: #fff;
--gradientee-color-to: #000;
--gradientee-color-randomness: 0;
--gradientee-deflection-level: 20;
--gradientee-triangles: 1;
--gradientee-seed: 1234;
}
Math.rand()
To build, simply run:
> npm install
> npm run build
FAQs
Randomized gradient background generator
The npm package gradientee receives a total of 1 weekly downloads. As such, gradientee popularity was classified as not popular.
We found that gradientee 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
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.