random-gradient

Generate beautiful random gradients

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
random-gradient
69130.0.26 years ago6 years agoMinified + gzip package size for random-gradient in KB

Readme

random-gradient Build Status
Generate beautiful random gradients


Install

$ npm install --save random-gradient

Usage

// with React

import gradient from 'random-gradient'

export default ({ name }) => {
  const bgGradient = { background: gradient(name) }

  return (
    <div style={bgGradient}>
      <h2>{name}</h2>
    </div>
  )
}

API

randomGradient(uid, type)

uid

Type: string
Required

type

Type: string
Default: diagonal
Options: diagonal, vertical, horizontal, radial

Related

License

MIT © Bu Kinoshita