Skip to content

Material Design linear gradient generator npm package for React πŸŽ¨πŸ–Œ

Notifications You must be signed in to change notification settings

rhysmitchell/material-gradient-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Material Gradient Generator

Intended use case is mainly for React when you need to iterate over items in a list and apply a soft, linear gradient to them, i.e. buttons or dashboard items.

  • Install the package:

    • npm i material-gradient-generator --save
  • Import the gradient genetator:

    • import { materialGradientGenerator } from "material-gradient-generator";
  • Use the generator! πŸ”₯

    • const colourGen = new materialGradientGenerator(false, 500, 200, 2);
    • const nextColour = colourGen.NextColour();
// excludeRed?: boolean
// darkShade?: number
// lightShade?: number
// _step?: number
const colourGen = new materialGradientGenerator(false, 500, 200, 2);
const nextColour = colourGen.NextColour();

<button className='btn btn-light' style={{ margin: "5px", backgroundImage: `${nextColour}` }}
    <i className='fa fa-free-code-camp'></i>
</button>

<button className='btn btn-light' style={{ margin: "5px", backgroundImage: `${nextColour}` }}
    <i className='fa fa-diamond'></i>
</button>

<button className='btn btn-light' style={{ margin: "5px", backgroundImage: `${nextColour}` }}
    <i className='fa fa-paper-plane'></i>
</button>

EXAMPLE.

About

Material Design linear gradient generator npm package for React πŸŽ¨πŸ–Œ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published