Chipsy is a simple, lightweight, and easy to use framework agnostic library that allows you to create beautiful multi-purpose pseudo random colors that can be used for chips, tags and more..
npm install chipsy
yarn add chipsy
bun install chipsy
pnpm install chipsy
import { getColors } from 'chipsy';
const colors = getColors('tag-name','light',{level:0.5});
// return object { primary:"hsl(...)", secondary:"hsl(...)", tertiary:"hsl(...)" }
getColors(name, theme, options)
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Label name |
theme |
string |
'light' or 'dark' |
options |
object |
|
options.level |
number |
0.0 to 1.0 |
- Generate pseudo random colors based on a name ( same name will always return same color )
- Configurable lightness level
- Supports dark and light themes (same color but different lightness level)
- Framework agnostic
- Lightweight and easy to use
Any feedback is greatly appreciated. If you have any suggestions or would like to contribute, please feel free to contact me.