palette icon indicating copy to clipboard operation
palette copied to clipboard

Improve chromatic adaptation API

Open Ogeon opened this issue 3 years ago • 0 comments

Description

The traits in chromatic_adaptation have turned out to "do too much". They both adapt white spaces and convert between color spaces. I'm thinking they could be changed to apply to Xyz only, since that's the space where it's done, and leave any conversion to the user. That way we don't force any kind of clamping and don't do anything else that may be surprising or unnecessarily destructive.

For extra flexibility, though, we could add a function that takes any source and destination white space, with Xyz<Any, T> parameters. A light source, for example, may not necessarily match a static white point.

Motivation

I want to remove hidden side effects and make them Do One Thing. Plus detailed control.

Ogeon avatar Jul 17 '21 15:07 Ogeon