Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
37K
decreased by-2.79%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc