Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-from-string

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-from-string

Convert any string to hex color code with predicable results

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
123
decreased by-23.6%
Maintainers
1
Weekly downloads
 
Created
Source

color-from-string

Zero-dependency, lightweight package to convert a given string (intended to use with user names) to a HEX color code. The library uses classic hash algorithm.

https://www.npmjs.com/package/color-from-string

Installation

npm i color-from-string

Usage

import colorFromString from 'color-from-string';

const name: string = "Sergey Klinov";

const colorCode: string = colorFromString(name);

console.log(colorCode); // #352475

Tests

npm run test

FAQs

Package last updated on 21 May 2022

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