Saturation modification API
seenaburns opened this issue · 3 comments
Because HSV saturation and HLS saturation are different, the direct modification properties has an unintuitive API:
c.hls_saturation
c.hsv_saturation
While this isn't a big issue, it makes Chroma's API less intuitive and harder to use.
Possible solution:
Create a .saturation property, but raise an error if it is called, explaining why hls_saturation and hsv_saturation exist and how to use them.
Wrote about my thoughts on abusing getattr, and I'm starting to become convinced this is the best approach.
Demo'd the approach as well, and it work like the default functionality + warnings if Color.saturation is called
Thought still debatable, I think the best approach is to override getattr as it is non-intrusive. I wish the API design could be better, but it's just unfortunate saturation is an ambiguous term.
Addressed in 4b92429