
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Standalone, lightweight and simple gradient generation tool
Want to get a palette array of interpolated color values of any length, based on an input array? Covered!
You can either install via npm, or manually from github:
// 1. in cli:
npm install gradiate --save
// 2. in js:
import Gradiate from 'gradiate';
let palette = Gradiate.get( 42, [ [70, 177, 217], [100, 207, 84], [255, 213, 68] ] );
console.log(palette); // logs an object with returned arrays as properties .hex .rgv and .rgbCsv
Fetch /lib/Gradiate.js (or /src/Gradiate.js if you don't support IE10- or are using transpiler) from the Github page
Load or integrate the file in your build/bundle/.html
Global object 'Gradiate' with method 'Gradiate.get( countInt, coloursArr )' is accessible.
// Gradiate.get() returns an object with array properties .hex .rgb and .rgbCsv
let paletteObj = Gradiate.get( 8, ['#46b1d9', '#64cf54', '#ffd544'] );
console.log( paletteObj.hex );
console.log( paletteObj.rgb );
console.log( paletteObj.rgbCsv );
// second example (array of [r,g,b] to comma-separated string 'r,g,b')
let paletteCsv = Gradiate.get( 11, [ [70, 177, 217], [100, 207, 84], [255, 213, 68] ] ).rgbCsv;
Note: If invalid input is supplied as the array argument, a fallback color of [0,0,0] will be used. The rationale behind this is that often colors are non-critical in program flow, and should thus not throw errors when incorrect input is provided.
Compiled production build (lib folder) will work in IE9+ (compiled with babeljs).
Pre-compiled development build (src folder) will work as-is in IE11+.
General Note: If running in IE compatibility mode, ES5 features (e.g. Array.isArray()) might have to be polyfilled.
None for usage, check package.json for build & test dev-dependencies if you want to make modifications. (or simply run 'npm install' in root of this package folder)
FAQs
JS tool for retrieving step gradients from arrays of colour values
We found that gradiate 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.