TypeScript MIT

theme-colors

🎨 Easily generate color shades for themes

U

unjs

Dernière activité 29 sept. 2026
unjs/theme-colors

269

étoiles

13

forks

15

issues ouvertes

colorsshadestailwindtailwindcsstheme

Ce README est souvent en anglais.

theme-colors

npm version npm downloads bundle Codecov

Easily generate color shades for themes

Usage

Install package:

# npm
npm install theme-colors

# yarn
yarn add theme-colors

# pnpm
pnpm install theme-colors

# bun
bun install theme-colors

Import:

// ESM
import { getColors } from "theme-colors";

// CommonJS
const { getColors } = require("theme-colors");

const theme = getColors("#ABABAB");
// Or using RGB
const theme = getColors("172,172,172");

This will generate the following shades:

{
  50: '#FBFBFB',
  100: '#F7F7F7',
  200: '#EAEAEA',
  300: '#DDDDDD',
  400: '#C4C4C4',
  500: '#ABABAB',
  600: '#9A9A9A',
  700: '#676767',
  800: '#4D4D4D',
  900: '#333333',
  950: '#222222',
}

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Inspired by javisperez/tailwindcolorshades

Made with 💛

Published under MIT License.

Projets similaires

Color shades generator for TailwindCSS - https://javisperez.github.io/tailwindcolorshades

Vuecolorscolorschemeshelper
Jjavisperez
764 étoiles57

11-color Palette Generator and API for Tailwind CSS

TypeScriptcolorspalettepalette-generation
SSimeonGriggs
1,3 k étoiles85

The ayu color scheme as a color palette

TypeScriptcolor-schemecolor-theme
Aayu-theme
855 étoiles37