tafalk/material-color-generator
Idempotently matches given string to a material color.
Light and dark classification is applied regarding the color chart here: If the text color is black for a background, it is considered as a light one; and if white, it is dark.
Install
npm install @tafalk/material-color-generator
And use it in your code like:
import { GetColor } from '@tafalk/material-color-generator'
const color = GetColor('my string', 'dark'); // -> something like 'ffffff'
Possibilities
GetColor
function matches one of the colors below and returns the RGB code.