Automatically fix hard-to-read text colors by making your website readable without changing your original color theme—simple Python API and CLI.
Project description
CM-Colors 🎨✨
Color contrast that works for everyone
CM-Colors automatically fixes your colors so they are easy to read. It finds similar colors that work for everyone, so you don't have to guess.
The percentage shows how much easier the text is to read:
Overview
Spending too much time adjusting colors? CM-Colors handles it for you. It automatically finds colors that look like your brand but are readable for all your visitors.
What it does:
- Fixes colors automatically: No more manual tweaking.
- Works everywhere: Fix Python code or CSS files.
- Keeps your style: Changes colors as little as possible.
- Saves you time: Fix your whole project in seconds.
Installation
pip install cm-colors
Quick Start
Fix a single color
from cm_colors import ColorPair
# Your colors
pair = ColorPair("#999999", "#ffffff")
# Fix them and preview in the terminal
fixed_color, success = pair.make_readable(show=True)
print(f"Use {fixed_color} instead of #999999")
# Output: Use #8e8e8e instead of #999999
Fix many colors at once
from cm_colors import make_readable_bulk
my_colors = [
("#777", "#fff"),
("#888", "#000"),
]
results = make_readable_bulk(my_colors)
for color, status in results:
print(f"{color} is {status}")
Fix CSS files
Run this in your terminal to fix all colors in a CSS file:
cm-colors styles.css
This creates styles_cm.css with readable colors which you can preview before you modify your original css
Documentation
For more details, see the full documentation.
License
GNU General Public License v3.0
Support
Found a problem? Let us know.
Stop guessing, start building.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cm_colors-0.5.0.tar.gz.
File metadata
- Download URL: cm_colors-0.5.0.tar.gz
- Upload date:
- Size: 42.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e4b82ec29a81834a77060454646e0dcf7c5d27b89baaad1d24d6290ec24f9a4
|
|
| MD5 |
2eeb1d53f62d132c93fea507c611e7c6
|
|
| BLAKE2b-256 |
2712837b5d5230c8b696a4aa930ccf945a4455bef62d926f00390f41240d2a32
|
File details
Details for the file cm_colors-0.5.0-py3-none-any.whl.
File metadata
- Download URL: cm_colors-0.5.0-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4548b73e96e29b6b1bdb5dfd0827aade9315a92d586e95b1d77e1c0692f2fa9
|
|
| MD5 |
71b525ed3d636628a07e75f0924437bc
|
|
| BLAKE2b-256 |
50db8c350f72520d5745cdcdf7c46725671ef7a1b9346c44434b79f066ae1984
|