June 17, 2025
And it's donee people!! Finally stable version is up for release and now it takes any hex or rgb strings too!!
Uff finally functional stuff are done for v0.1.0 refactor
The core function tunecolors() takes 2 values - a text color, bg and basically sees if it's readable enough aka is the contrast high enough ?
If yes, just returns the original text color, isaccessible=True
else is where our magic comes in,
At first I was trying to brute force and search the color space of the text color, such that the tuned color isnt too different but just enough for it to be accessible
Now we use binary search x gradient descent
- First try to play with lightness of a color to see if it's enough
- If not, use gradient descent to maximise the contrast and minimise the color difference of tuned text color vs original text color ( measured by deltaE2000 - really cool, look it up )
The result is what you would see in the project's banner image
We already got 4 contributors, can you believe that? omg
Let's go and make the world more accessible!!
Who knew math would come to help so much in here
Let's goo refactor and stablise the public API
Ready for release
Sarvam shri krishna sankalpam <33
Released v0.0.3 - will work on polishing it up now
will work on cli now
Core tools are done, yet to create cli and finish docs
Please work and count devlog time!!! :(
Please work and count devlog time!!! :(
Will ship this now
💙sarvam shri krishna sankalpam💙
Done with the basic version,, will add more styling later
Solves: How can I make this color combination accessible with the least possible visual change to preserve brand identity, using the most accurate color science?
Release Date: July 17, 2025
We are thrilled to announce the initial public release of CM-Colors, a powerful Python library designed to revolutionize how developers approach color accessibility. Built with research-grade mathematical precision, CM-Colors helps you improve color contrast while thoughtfully preserving brand identity and minimizing visual impact.
This inaugural release provides a robust set of tools for calculating contrast ratios, performing perceptually uniform color adjustments, and ensuring WCAG 2.1 compliance with a brand-conscious approach.
Mathematically Rigorous Color Science Core:
Smart Accessibility Improvement Algorithms:
CMColors().ensure_accessible_colors()
and CMColors().find_accessible_text_color()
automatically adjust colors to meet WCAG AAA standards.Comprehensive Color Space Conversions:
CMColors().rgb_to_oklch()
: Convert RGB colors to the perceptually uniform OKLCH space for better manipulation.CMColors().oklch_to_rgb()
: Convert OKLCH colors back to RGB.CMColors().rgb_to_lab()
: Convert RGB colors to the CIELAB color space, essential for Delta E calculations.CMColors().calculate_oklch_distance()
: Measure perceptual distance directly in the OKLCH color space.Core WCAG Compliance Utilities:
CMColors().calculate_contrast()
: Calculates WCAG contrast ratio between text and background.CMColors().get_wcag_level()
: Determines WCAG compliance level (AAA, AA, FAIL) for normal and large text.Robust Input Validation: All public methods include validation for RGB (0-255) and OKLCH (L: 0-1, C: >=0, H: 0-360) values, raising ValueError
for invalid inputs.
Get started by installing the library:
pip install cm-colors
from cm_colors import CMColors # Or 'from main import CMColors' if running locally
cm = CMColors()
# Check contrast ratio and WCAG level
ratio = cm.calculate_contrast((100, 100, 100), (255, 255, 255))
print(f"Contrast ratio: {ratio:.2f}")
print(f"WCAG Level: {cm.get_wcag_level(ratio)}")
# Automatically fix accessibility for text color
accessible_text, _ = cm.ensure_accessible_colors((100, 100, 100), (255, 255, 255))
print(f"Improved text color: {accessible_text}")
# Calculate perceptual color difference (Delta E 2000)
delta_e = cm.calculate_delta_e_2000((255, 0, 0), (250, 5, 5))
print(f"Delta E 2000: {delta_e:.2f}") # Small perceptual difference
For more detailed examples, including color space conversions and advanced optimization insights, please refer to the README.md on GitHub or the full documentation.
License
This project is open-source and licensed under the GNU General Public License v3.0 (GPLv3).
Built with mathematical precision based on:
WCAG 2.1 Guidelines
CIE Color Science Standards
Delta E 2000 Specification
OKLCH Color Space Research
Making the web more accessible, one color at a time. 🎨✔️
Built with mathematical precision for practical accessibility improvements.
Gonna ship it yay!! Finally done
CM-Colors 🎨
Mathematically Rigorous Accessible Color Science Library
An open-source Python library for improving color accessibility while preserving brand identity. Built with research-grade mathematical precision and practical accessibility tools.
💙Sarvam shri krishna sankalpam💙
Okay base helpers are done, will polish it, write docs and publish it to pypi
You do your style, we make it accessible. Like, have you ever made your site look super aesthetic and then someone’s like “uhh, I can’t read this”? Same. CM-Colors takes your color combos and makes just-enough tweaks so they still look good, but now it's easier on the eyes to read - aka passes accessibility contrast ratio :> A mix of math x color science to make it happen ( Think gradient descent, binary search, oklch color space ) - Checkout the Technical README if interested
Deployed on https://lalithaar.github.io/learn-better/
Will ship it noww
sarvam shri krishna sankalpam <3
Almost done!!! Functional and works
Will refine the copy within the app and ship it soon yay!
Done with the base UI
Yet to work on making the input data reactive, and will add the final note generation + formatting later
Break down complex ideas until even a 5-year-old could nod along. Learn Like You Are 5 is your thinking playground — a step-by-step space where you explore a topic deeply, gently, and creatively. Start with what the textbook says. Spot what confuses you. Then reimagine it in your own metaphors, reflections, and plain words. You’re not cramming. You’re connecting the dots. By the end, you’ll have more than just understanding — you’ll have a full, clean set of notes in Markdown that you can download, revisit, or share. And yes, you can see them rendered on the page as you go — like magic. This tool is made for students who want to truly get it — with a kind nudge and a clever twist.
Done with the base. Imported most of the stuff needed and formatted it with Python scripting.
Yet to fix:
- Broken links all over the site and redirects if any
- Fix formatting error in the blog post as I accidentally generated 2 titles in each blog post's content
- x-button and expand-button aren't working. Maybe I will leave the x-button as it is fixing only the alignment. Will work on expand-button.
- Loads of comments about him in the middle of code, marked with temp, will delete those later ( sadly nahh gonna leave the comments )
- make it responsive or leave it at that,, the site looks good on big view,, and I feel it breaks the design theme on small view
Ship it by tomorrow hopefully
converted the base to a modular approach with jekyll, will work on updating right and left sidebars
This was widely regarded as a great move by everyone.