gtaylor / python-colormath

A python module that abstracts common color math operations. For example, converting from CIE L*a*b to XYZ, or from RGB to CMYK
python-colormath.readthedocs.org
BSD 3-Clause "New" or "Revised" License
456 stars 83 forks source link

Update color_conversions.py #29

Closed ChameleonRed closed 10 years ago

ChameleonRed commented 10 years ago

Fixed bug with invalid constant.

Less code to read.

gtaylor commented 10 years ago

What bug is this fixing? I'm not seeing any difference in the Lab test results.

gtaylor commented 10 years ago

I spent some more time poking at this. Looks like it's a straight code re-arrange with no mathematical difference, unless I am missing something. The constants we have in colormath are pre-computed, but work out to be the same as what you've got here.

Readability takes a step back in this PR, so I'm going to close this one. If there is a mathematical snag that you are hitting that this PR addresses, please re-open and elaborate.

ChameleonRed commented 10 years ago

I think that code is more readable:

It is also much faster and more readable.

I am not done code compression but cut what is not readable. Fix this code since it is not good now.