Home

Awesome

🎨 PigmentTS

npm npm

<img src="./public/banner.png" alt="PigmentTS Banner" style="width: 100%"> <br>

A lightweight JavaScript/TypeScript utility for seamless color manipulation and conversion. Tailwind CSS support is built-in.

Visit the playground to try out the library. <br> See the documentation for the library

Supported Formats - HEX, RGB, HSL, RGBA, HSLA, Tailwind CSS


✨ Features

More features coming soon!


🔮 What's New in v0.2


pre Features

Features that are ready for the next release. You can try them out in the playground. They are marked with "(pre)" in documentation.


🚀 Getting Started

Installation: Install PigmentTS via npm

npm install pigment-ts

Usage

Import all the function you need

import { convertColor, lightenColor, toTailwind } from "pigment-ts";

// Convert HEX to RGB
const rgb = convertColor("#ff5733", "rgb");
console.log(rgb); // 'rgb(255, 87, 51)'

// Lighten a color by 20%
const lighter = lightenColor("#ff5733", 20);
console.log(lighter); // '#FF8A66'

// Get Tailwind CSS class
const twClass = toTailwind("#ef4343");
console.log(twClass); // 'red-500'

Use all functions via default import

import PigmentTS from "pigment-ts";

const randomHex = PigmentTS.randomColor("hex");
console.log(randomHex); // '#A1B2C3'

🗺 Roadmap

See the ROADMAP file for a list of features that are planned for future releases.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contribution

See the CONTRIBUTING file for more information on how to contribute to this project.


Support me by giving a ⭐ if you find this project useful!