3 ms·
Yes, the library definitely does need some stronger specs. Thanks for flagging. Addressing these two specific issues: > Is the rgb space actually sRGB? Yes. A
by jsvine 12y ago
Yes, the library definitely does need some stronger specs. Thanks for flagging. Addressing these two specific issues:
> Is the rgb space actually sRGB?
Yes. Added: https://github.com/jsvine/spectra/commit/7f1ac6f5287340ed356df389cdd61ba3c980c2b1 https://github.com/jsvine/spectra/commit/7f1ac6f5287340ed356...
> And what is the parameter to brighten/darken/saturate/desaturate?
The parameter for brighten/darken is a positive/negative linear adjustment to the L(ightness) value of the color's Lab representation. (Spectra converts the color to Lab, makes the change, and then converts back to the original color space.)
Likewise, the parameter for saturate/desaturate is a positive/negative linear adjustment to the c(hroma) value of the color's Lch representation.
Added a note here: https://github.com/jsvine/spectra/commit/fd3cbde9338ce3888491472724d4d18d36930535 https://github.com/jsvine/spectra/commit/fd3cbde9338ce388849...
The goal is to, ultimately, have all these details in the docstrings: https://github.com/jsvine/spectra/issues/1 https://github.com/jsvine/spectra/issues/1
- mark-r 12y agoWhat happens when the adjusted color goes out of gamut?
- jsvine 12y agoAnother thanks for flagging, mark-r. I've updated spectra to address this issue more explicitly. Per colormath[0], colors are allowed to go out of gamut. Colors now have `mycolor.rgb` and `mycolor.rgb_clamped` properties; `mycolor.hexcode` uses the clamped values. Are there other ways you'd like to see the out-of-gamut issue addressed? Open to suggestions. [0]: http://python-colormath.readthedocs.org/en/latest/conversions.html?highlight=clamp#rgb-conversions-and-out-of-gamut-coordinates http://python-colormath.readthedocs.org/en/latest/conversion...