2.0.0 • Published 3 years ago

hue-radar v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

hue-radar is a CLI tool for discovering all of the colors used in your project.

Purpose

If not maintained well, large and long-running web app projects are likely to have colors littered throughout the codebase. This can make it difficult for your design or front-end team to audit, scale and maintain in the long run. This tool was created to help you identify and wrangle every color in your codebase.

It's sort of like greping for various colors, but better for the following reasons:

  • Handles lots of edge-cases that a complex grep may miss.
  • Supports all color types (eg: hex, hsl, rgb(a)).
  • Presents findings in a normalized and reasonable way.
  • Can produce a comprehensive color audit report for you.

Installation

Note: This has only been tested on NodeJS v12+. It is unlikely to work on versions below this.

Install the tool in your project, or (optionally) you can do it globally.

yarn add hue-radar
npm i hue-radar

# Or globally
npm i -g hue-radar

Usage

Call hue-radar with the options you desire, in the project.

hue-radar -p "*/**.{less,jsx}"

Options

OptionDescriptionDefaultNotes
--pattern, -pGlob pattern for files to match. More info."**/*.css,!node_modules/**/*"Defaults are always included before these patterns., so specify overrides if these do not suit you.
--debug, -dPrint debug statements.false
--format, -fOutput format for the color report, json or htmljson
--output, -oPath to the color report outputted file (optional).hue-radar.report.{format}
--sort-algorithm, -sAlgorithm for sorting colors (distance | deltaE).distanceSort by either Euclidean distance (distance) or deltaE color difference (deltaE).
--convert-to-hex, -hConverts all rgb/hsl colors in the report to hex, for grouping purposes.falseYou will still see the discovered source color, this just helps group same colors.

Contributing

Feel free to file issues with ideas or questions, or submit pull requests with new features or bugfixes.

When submitting pull requests, at the very least please add unit tests for any new functionality, and follow the code styles set forth in the config.

License

FOSSA Status


✌️ Built by Dave.