🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

string-to-color

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-to-color

Generates color from any string or any object

2.2.2
latest
Source
npm
Version published
Weekly downloads
47K
-1.37%
Maintainers
1
Weekly downloads
 
Created
Source

String to color

Alt text

npm version

Generate time invariant color from any string or any object.

Install

npm install string-to-color
yarn add string-to-color

Demo

https://gustu.github.io/string-to-color/

Usage

const stc = require('string-to-color');
const color = stc('string'); // => "#7f1de4"

or just generate color from any object, even null!

const color = stc(null); // => "#1ad64b"

Another feature is that when your string contains color name, output will more or less equal to that color

const color = stc("i am a red fox"); // => "#f03d22"

When multiple colors are provided, they will be mixed with each other

const color = stc("red green blue"); // => "#7f5b78"

License

MIT.

Keywords

color

FAQs

Package last updated on 06 Aug 2020

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