/pastellify

Deterministically turn any string into a soft pastel color. 🟣

Primary LanguageTypeScriptMIT LicenseMIT

Pastellify

npm npm version npm downloads sponsors

Deterministically turn any string into a soft pastel color. 🟣

  • 🪶 Extremely lightweight: Source code is only 4 lines long.
  • âš¡ Blazingly fast: Does not rely on any other package. Just gets the job done.

Try it out here: https://diragb.github.io/pastellify/

Installation

npm install pastellify --save
yarn add pastellify ## or in yarn

Usage

import pastellify from 'pastellify'

pastellify('Hello!') // [330, 78, 73]
pastellify('Hello!', { saturation: 68, lightness: 65 }) // [330, 68, 65]
pastellify('Hello!', { toCSS: true }) // 'hsl(330, 78%, 73%)'

Inspiration

I've often found myself using generic profile picture icons for users and thought that was very boring.


"i am not vibing with this icon" ~me all the time fr

Pastellify allows me to create deterministic and unique profile picture experiences for users based on their usernames. But you can use this for anything, really.

License

MIT