Unhex - convert colors to RGB, HEX or HSL in bulk

aspnxdd

Arnau Espin

Posted on September 20, 2022

Unhex - convert colors to RGB, HEX or HSL in bulk

Working on a large codebase with multiple css files, inline styles and tech lead says all colors now gotta be as HSL?

Changing 1 by 1? Forget that.

In this tutorial we will discover unhex - a nodeJS package that replaces all the colors in all the files you choose in a given directory.

Github Repository

npm link

Go to your project root directory and run npx unhex@latest a CLI inquirer will appear. Select which file extensions you wish to modify, ignore any files (like node_modules) and you are ready to go!

All the files matching your configuration will be parsed and modified to whatever color representation you chose!

Logs of running npx unhex@latest

💖 💪 🙅 🚩
aspnxdd
Arnau Espin

Posted on September 20, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related