webdesserts / alchemist-js

The extensible color library
https://webdesserts.gitbooks.io/alchemist-js/
MIT License
11 stars 2 forks source link

Precision should only affect the export value #14

Closed webdesserts closed 9 years ago

webdesserts commented 9 years ago

Right now precision is enforced throughout the entire conversion process. For color spaces like Lab where a small decimal change makes a big difference, this can ruin a conversion. we should wait to round the value until it's exported via a .to() method.

Note: this might also be a reason to use fixed instead of precision

webdesserts commented 9 years ago

Something to consider: if we change the precision for "color.to()" it would be inconstant with the precision of color.value. Plugins will be using color.value all the time, so even if we tried to wait until the last moment, the calculations would still be affected by the precision change. I think we should keep the current functionality and just reinforce the downsides or reduced precision in the docs.

If the user wants it, give it to them. Don't baby them.

webdesserts commented 9 years ago

We could add a precision option to the color.to() function to override the current precision. Obviously this would only work when moving from a larger precision to a smaller precision.

webdesserts commented 9 years ago

Closing this issue and opening a new one for the color.to() option