Socket
Book a DemoInstallSign in
Socket

chipsy

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chipsy

Generate psuedo random colors for UI elements like chips, tags, badges, etc..

latest
Source
npmnpm
Version
1.1.7
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

Chipsy

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..

MIT License Build Status NPM Downloads NPM Version NPM Bundle Size

Installation

npm install chipsy
yarn add chipsy
bun install chipsy
pnpm install chipsy

Usage

import { getColors } from 'chipsy';
const colors = getColors('tag-name','light',{level:0.5});
// return object { primary:"hsl(...)", secondary:"hsl(...)", tertiary:"hsl(...)" }

Screenshots

Screenshot

API Reference

Get color

  getColors(name, theme, options)
ParameterTypeDescription
namestringRequired. Label name
themestring'light' or 'dark'
optionsobject
options.levelnumber0.0 to 1.0

Features

  • 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

More

  • Demo and playground

License

MIT

Feedback / Suggestions / Contributions

Any feedback is greatly appreciated. If you have any suggestions or would like to contribute, please feel free to contact me.

Keywords

chips

FAQs

Package last updated on 23 Jan 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.