3 releases
| new 0.1.2 | Feb 26, 2026 |
|---|---|
| 0.1.1 | Sep 26, 2020 |
| 0.1.0 | Sep 26, 2020 |
#770 in Command line utilities
12KB
239 lines
contrast-checker
A simple Rust-based CLI tool for calculating the contrast ratio between two colours.
Colour contrast ratio is calculated based on WCAG 2.0 guidelines.
Installation
If you have Rust installed, you can run
cargo install --path .
Usage
You can calculate the contrast between two colours by using:
contrast-checker <color1> <color2>
color1 and color2 are entered as a Hex code (i.e. #ffffff) or as a comma separated RGB list (i.e. 255,255,255). The # for Hex code is optional.
For example:
contrast-checker #ffffff 255,255,255
Dependencies
~3MB
~32K SLoC