🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

rainbow-gradient

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rainbow-gradient

Generates a gradient of the colors of the rainbow.

1.0.0
latest
Source
npm
Version published
Weekly downloads
44
-32.31%
Maintainers
1
Weekly downloads
 
Created
Source

rainbow-gradient

Generates a gradient of the colors of the rainbow.

package build downloads minified size minzipped size

Install

  • npm install rainbow-gradient --save or
  • yarn add rainbow-gradient

Use

import rainbowGradient from 'rainbow-gradient';

// Creates an array with three colors:
rainbowGradient(3);

// Creates an array with 10 colors, darkened and washed out:
rainbowGradient(10, 0.5, 0.25);

Parameters

  • length

    The number of colors in the resulting gradient array.

  • saturation

    The saturation of the colors. 0 represents grayscale. 1 represents full color. Default: 1.

  • lightness

    The lightness of the colors. 0 represents black. 1 represents white. Default: 0.5.

Return Value

The function returns an array of colors based on the parameters. Each color is an array of red, green, and blue values from 0 to 255.

Example:

rainbowGradient(3) returns:

[
  [ 255, 0, 0 ],
  [ 0, 255, 0 ],
  [ 0, 0, 255 ]
]

Keywords

rainbow

FAQs

Package last updated on 11 Aug 2018

Did you know?

Socket

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