gradient-partitioner

Awesome layouts with gradient partitioner.


Keywords
gradient, css, slice, division, partition, parts, split, gradient-partitioner, gradients, partitioning, slice-gradient
License
MIT
Install
npm install gradient-partitioner@1.0.4

Documentation

Gradient Partitioner

A simple library to slice gradients for node and browser.

Install

NPM

npm install --save gradient-partitioner

Yarn

yarn add gradient-partitioner

Usage

ES6

import GradientPartitioner from 'gradient-partitioner'

const range = new GradientPartitioner('#F05F57', '#360940', 0, 100)
range.partition(0, 45).cssGradient() // linear-gradient(to right, rgb(240, 95, 85), rgb(156, 56, 77))

Legacy

var GradientPartitioner = require('gradient-partitioner')

var range = new GradientPartitioner('#F05F57', '#360940', 0, 100)
range.partition(0, 45).cssGradient() // linear-gradient(to right, rgb(240, 95, 85), rgb(156, 56, 77))

Example

Example

To Do

  • Serialize to legacy browsers
  • 2d gradient with angle
  • Radial gradients
  • Multiple colors

License

MIT License

Copyright (c) 2017 Mateus Calza