Skip to content
JavaScript micro library to generate gradient color stops πŸ³οΈβ€πŸŒˆ
Branch: master
Clone or download
Latest commit d3331fb Jun 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Refresh build Apr 7, 2019
src Drop Math.trunc polyfill Apr 7, 2019
.babelrc Modify build process to support npm package Aug 31, 2018
.gitignore Delete package-lock Jun 7, 2019
.travis.yml Add travis config Dec 30, 2018
LICENSE
README.md Update README.md Apr 7, 2019
gradient strip.png image for markdown added Aug 6, 2015
gradstopUMD.js Refresh build Apr 7, 2019
index.js Restructure code and use better variable names Jan 5, 2019
package.json 2.2.3 Apr 7, 2019
test.js Add tests for utility functions Jan 5, 2019

README.md

gradstop

NPM Version NPM Downloads License: MIT Build Status

JavaScript micro library to generate gradient color stops

Demo UMD Bundle

Usage:

npm install gradstop
import gradstop from 'gradstop';

const gradient = gradstop({
    stops: 5,
    inputFormat: 'hex',
    colorArray: ['#343838', '#00DFFC']
});

console.log(gradient);
// rgb(52,56,56), rgb(39,97,105), rgb(26,139,154), rgb(13,181,203), rgb(0,223,252)

Gradient Strip


Default Parameters:

  • inputFormat: 'hex' (supports hex, rgb and hsl)
  • stops: 5
  • colorArray: ['#fff', '#000'] (supports upto 4 values)

Both shorthand(#fff) and standard(#ffffff) format hex values are supported.

Polyfills required:

  • Math.trunc
You can’t perform that action at this time.