Socket
Socket
Sign inDemoInstall

gradient-css

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gradient-css

Css module of the gradient.js library


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

gradient-css.js

This module creates css gradient output for gradient.js modules.

License   Travis build  Codecov

Table of contents


gradient.js

Gradient creation library running in the browser 🖌🌈

gradient.js is a javascript module that takes your source colors array and configuration object, and returns a gradient suitable for your needs.

Gradient maker uses chroma-js color manipulation library for gradient generation (Copyright (c) 2011-2017, Gregor Aisch).


Usage

const css = new Css()

const gradient = css.get([
    [100, 34, 230, 0.5],
    [10, 33, 20, 0.6],
    [1, 12, 12, 0.3]
],{
    base: {
        interpolation: 'linear',
        mode: 'rgb',
        samples: 40,
        lightnessCorrection: true
    },
    css: {
        type: 'radial',
        top: 30,
        left: 20,
        shape: 'circle'
    }
})

Options

{
    type: 'linear' | 'radial'
    angle?: number // between 0 and 359
    shape: 'ellipse' | 'circle'
    top?: number
    left?: number
    extent?: 'farthest-side' | 'closest-side' | 'farthest-corner' | 'closest-corner'
}

The angle is ommited when the type is set to radial.

The extent keyword is ignored if the shape is set to the circle and the type is set to linear.

When you set the type to radial, you must provide valid shape property.

Keywords

FAQs

Last updated on 05 Aug 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc