JSPM

filter-gradient

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 346
  • Score
    100M100P100Q87753F
  • License MIT

Generate filter gradients for the old IE.

Package Exports

  • filter-gradient

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (filter-gradient) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

filter-gradient

Generate filter gradients for the old IE

Build Status

Install

npm install filter-gradient --save

Usage

var filterGradient = require('filter-gradient');
var gradient = filterGradient('#7abcff', '#4096ee'/*, 0 or 1*/);

console.log(gradient);
// progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff7abcff', endColorstr='#ff4096ee', GradientType=0)

API

filterGradient(startColor, endColor?, gradientType?);

startColor

Type: string

The start color. Any CSS color formats, like blue, rgb(), rgba(), #RRGGBBAA, hsl()

endColor

Type string

The end color. Like startColor, but it's optional. If you omit this, it will use the startColor, it will be useful if you want generate rgba() fallback for old IE.

gradientType

Type number

0 or 1. 0 is vertical gradient, 1 is horizontal gradient, default value is 0;

CHANGELOG

2015-12-20

  • Make the filter string more regular
  • Change color string lower case

2015-11-11

  • First release.

LICENSE

MIT