Generate consistent, accessible color palettes for your design system. Transform any color into a complete 11-shade Tailwind CSS palette.
Generate complete palettes instantly with our optimized algorithm. No waiting, no complex setup.
Use anywhere - ESM, UMD, Node.js. TypeScript support included out of the box.
Pick any color and see the magic happen
Choose your preferred way to integrate
Modern JavaScript/TypeScript
// Install
npm install @freshworks/dew-theme-generator
// Import
import { generatePalette } from '@freshworks/dew-theme-generator';
// Use
const palette = generatePalette('#3b82f6');
console.log(palette['500']); // '#3b82f6'
Direct browser usage
<script src="path/to/index.umd.cjs"></script>
<script>
const { generatePalette } =
window.TailwindPaletteGenerator;
const palette = generatePalette('#3b82f6');
console.log(palette);
</script>
Server-side usage
// CommonJS
const { generatePalette } =
require('@freshworks/dew-theme-generator');
// Generate palette
const colors = generatePalette('#3b82f6');
// Use in your build process
fs.writeFileSync('colors.json',
JSON.stringify(colors, null, 2));
Simple, powerful functions for color generation
Generate a complete 11-shade Tailwind palette from any color.
inputColor: string
Valid hex color (e.g., "#3b82f6")
{ [shade: string]: string }
Object with shades 50-950
const palette = generatePalette('#3b82f6');
// Returns: {
// '50': '#eff5ff',
// '100': '#dbe8fe',
// ...
// '950': '#172e54'
// }
Get a specific shade from the generated palette.
inputColor: string
Valid hex color
variant: string | number
Shade key (50, 100, ..., 950)
string
Hex color for the variant
const color700 = generatePaletteVariant(
'#3b82f6',
'700'
);
console.log(color700); // '#1d4ed8'