Re: [css-houdini-drafts] [css-typed-om] Do we need separate classes per color space? (#1034)

Thanks!

If you're not mutating the original colors, I think all of these cases would involve calling a conversion function to get a fresh object, right? So that feels similar to what we already have, especially if we switch to a generic `.to()` function.

I suppose if you were just reading the color in another colorspace, and doing so in a sufficiently simple way, then a more direct "give me this channel in this colorspace" API (like Color.js's `color.xyz.x` access) could be reasonable, but I think all the cases you've given want to read *all* the channels anyway, and you don't want to redo the conversion multiple times, right? It could memoize under the hood, I suppose, to avoid repeated conversions of the same color.

I don't *think* that in any of these cases you're switching *back* to the original color space, right? Well, in all of your examples there are *two* colors, and as you say they can be in different color spaces anyway, so I'm not even sure what "back" would mean there.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1034#issuecomment-840670977 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 13 May 2021 16:19:54 UTC