@bezlepkin/stringtohexcolor

1.0.2 • Public • Published

Description

Code generation based on string. Parses a line into words and picks up the first letter of each word. Returns an object with the first letters of each word and color. Often used to generate user photos. You can see this in Telegram, WhatsApp and others.

Installation

NPM

$ npm install @bezlepkin/stringtohexcolor

Usage

import stringtohexcolor from '@bezlepkin/stringtohexcolor'
console.log(stringtohexcolor('Igor Bezlepkin'))

Return object:

{
  string: 'ib',
  color: '371de6' (HEX)
}

Package Sidebar

Install

npm i @bezlepkin/stringtohexcolor

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

1.56 kB

Total Files

3

Last publish

Collaborators

  • bezlepkin