New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

randomized-colors

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomized-colors

tool for converting html colors and creating randomized variations

latest
Source
npmnpm
Version
0.0.32
Version published
Weekly downloads
1
-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

RandomizedColors

A random utility which allows to create random color variations

#Why you could need this

It might occur to that you you want tol use subtle color variations, Checking the rgb, rgba or (even worse) the hex values of html colors is a cumbersome task. So the idea is that you pass a known color and receive random variations that you can calibrate with a randomness parameter. If you set the randomness parameter to 0, just may use it as a color converter tool too. There might be moments when this could produce nice aesthetic effects, since you are regulating affinties.

#Installation

	npm install randomized-colors

#Usage

First you require the library:

	var randomized = require("randomized-colors");

Invoking is straightforward: You just write:

	var output = randomized("gold", 0.2);

The seconed parameter stands for the randomness of the result: 1 is total randomness, 0 no randomness at all.

You may also use a third parameter, which stands for the format. Valid formats are rgb, rgba, hex, array, object

You would invoke it like this:

	var output = randomized("gold", 0.2, "rgba");

Since the function is overloaded it supports a variety of input formats. You may write:

	
	var output = randomized("rgb(32,32,32)", 0,0.2, "object");
	
	// or

	var output = randomized("rgb(32,32,32)", 0,0.2, "array");	
	

Keywords

colors

FAQs

Package last updated on 08 Oct 2015

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