Re: [csswg-drafts] [css-fonts-5] Proposal: Animating font-palette (#8922)

The CSS Working Group just discussed `[css-fonts-5] Proposal: Animating font-palette`, and agreed to the following:

* `RESOLVED: add palette-mix(), bikeshed on the issue about the interpolation color space`

<details><summary>The full IRC log of that discussion</summary>
&lt;fremy> drott: in a previous call, we made a presentation where we animated font color palettes<br>
&lt;fremy> drott: we would like to extend the list of animatable properties with this<br>
&lt;myles> q+<br>
&lt;fremy> drott: we are motivated by requests by type foundries and some authors<br>
&lt;fremy> drott: our proposal is to add a palette-mix function<br>
&lt;fremy> drott: similar to color-mix<br>
&lt;fremy> drott: this is mostly need to represent the result as a value, but not sure this is needed for authors otherwise<br>
&lt;fremy> drott: you would just transition from one to another<br>
&lt;fremy> drott: but if you are interested in the computed value, this is what you get<br>
&lt;fremy> drott: for completeness, you can probably nest them<br>
&lt;chris> q+<br>
&lt;ntim> q+<br>
&lt;fremy> drott: this function should be added as a potential value for the font-palette proporty<br>
&lt;fremy> drott: we have a working draft edit already<br>
&lt;fremy> drott: chris and TabAtkins reviewed this, and the feedback was positivie<br>
&lt;miriam> ack myles<br>
&lt;fremy> drott: we would like to resolve on it<br>
&lt;TabAtkins> q+<br>
&lt;fremy> myles: is the function truly necessary?<br>
&lt;fremy> drott: to represent the computed value<br>
&lt;emilio> q+<br>
&lt;fremy> myles: do people want that computed value?<br>
&lt;fremy> drott: I think not to do this, why would font-palette be different?<br>
&lt;fremy> drott: also, you need an internal representation of this anyway<br>
&lt;fremy> TabAtkins: usually, we can't animate things that cannot be represented<br>
&lt;fremy> myles: we can in theory do this<br>
&lt;TabAtkins> ack TabAtkins<br>
&lt;miriam> ack chris<br>
&lt;fremy> TabAtkins: yes, but that would not be among the things the spec allows<br>
&lt;fremy> chris: I like that this looks like color-mix<br>
&lt;fremy> ntim: what is the difference between mix and palette mix?<br>
&lt;fremy> chris: mix does not allow to specify color spaces<br>
&lt;astearns> ack ntim<br>
&lt;emilio> q- later<br>
&lt;fremy> ntim: what about the default color space?<br>
&lt;astearns> q+<br>
&lt;emilio> q-<br>
&lt;fremy> drott: at the moment, if you go from or to, it goes from/to the default, which is the one from the font<br>
&lt;miriam> ack ntim<br>
&lt;fremy> ntim: what if there was a mix just for color spaces, what about a more general purpose mix function?<br>
&lt;fremy> chris: the issue with mix(...) is that it's difficult to implement<br>
&lt;dbaron> (looks at the existing color-interpolation property...)<br>
&lt;TabAtkins> We'll talk about mix() later, but ntim was asking about a general color-interpolation control, not mix()<br>
&lt;astearns> q-<br>
&lt;fremy> chris: while palette-mix is easy to understand<br>
&lt;fremy> ntim: I don't think you can you set a color-space just for that animation<br>
&lt;fremy> ntim: if mix was implemented, would that solve the problem?<br>
&lt;dbaron> https://svgwg.org/svg2-draft/painting.html#ColorInterpolation<br>
&lt;fremy> chris: in theory mix is nice, but it's difficult to track all the dependencies<br>
&lt;dbaron> (I'm not saying this is what we want, but we do already have a global color interpolation control property)<br>
&lt;fremy> ntim: what about a color-space-animation property?<br>
&lt;TabAtkins> Yes, mix() is just *precisely* what the `from { prop: start; } to { prop: end; }` behavior is.<br>
&lt;fremy> drott: that would be another thing, I'm not opposed<br>
&lt;fremy> drott: what you can do today is the use the function and animate the percentage<br>
&lt;fremy> chris: (missed) would be more complicated and would not be moving as fast<br>
&lt;miriam> ack dbaron<br>
&lt;fremy> chris: I see the point about generality, but I think this isn't the best strategy forward<br>
&lt;myles> q+<br>
&lt;fremy> dbaron: if we wanted a global color mixing function, and we should add these things on the same place rather than duplicate<br>
&lt;miriam> ack myles<br>
&lt;fantasai> s/and we should/there's a color-interpolation property in SVG. We should/<br>
&lt;TabAtkins> We *could* just use the property name and deprecate/remap the old values if needed. We did that for image-rendering<br>
&lt;fantasai> +1<br>
&lt;dbaron> s/if we wanted/not saying we want to, but if we wanted/<br>
&lt;fremy> myles: from what I understand, the computed value shoud not create new at-rules<br>
&lt;fremy> myles: so, we have to express this in a mix<br>
&lt;fremy> myles: we already have this in font-features<br>
&lt;fremy> myles: do we need a font-features-mix() function?<br>
&lt;fremy> chris: aren't those things you should just flip<br>
&lt;fremy> myles: but they could be animatable in theory?<br>
&lt;fremy> myles: if so, where do we stop?<br>
&lt;astearns> glancing at https://developer.mozilla.org/en-US/docs/Web/CSS/@font-feature-values they do look discrete<br>
&lt;fremy> drott: the concrete question is answered that these are discrete and not animatables<br>
&lt;chris> s/(missed)/colorspace-aware transitions<br>
&lt;fremy> drott: for the more abstract question, I don't foresee an explosion of mix functions in the future<br>
&lt;fremy> myles: we already have three<br>
&lt;fremy> drott: we could not come up with a more minimal syntax, also<br>
&lt;fremy> myles: I'm not gonna block this, but I would like to be on the record that I don't think this is the best idea<br>
&lt;fremy> TabAtkins: just to clarify more<br>
&lt;fremy> TabAtkins: font-features cannot be animated, so the question there is moot<br>
&lt;fremy> TabAtkins: font-variant values would be, but the animation is discrete, you cannot interpolate<br>
&lt;fremy> TabAtkins: so, we will add custom interpolation functions if you have values, which you need to smoothly interpolate, and you cannot represent the internals<br>
&lt;fremy> miriam: what about just tell the colors?<br>
&lt;emilio> q+<br>
&lt;fremy> TabAtkins: an unnamed palette does not exist now, so we would have to add this<br>
&lt;astearns> s/miriam/astearns/<br>
&lt;fremy> TabAtkins: sounds more work<br>
&lt;astearns> finally understands why color-mix() is insufficient<br>
&lt;fremy> myles: the value space of a shorthand is a smaller space then you cannot get as an empty string because the shorthand is out of the value space of the property<br>
&lt;fremy> myles: I view this case as similar<br>
&lt;miriam> ack emilio<br>
&lt;fremy> TabAtkins: one big difference is that you can get the value with the longhands<br>
&lt;fremy> TabAtkins: here you just cannot anymore<br>
&lt;fremy> emilio: you will need this internally anyway<br>
&lt;fremy> emilio: adding code to parse it is not much more work<br>
&lt;fremy> myles: but still, the use case does not warrant this effort, is my claim<br>
&lt;TabAtkins> Counter is that the CSS model *does not allow* animating without being able to obtain a computed value of the interpolation.<br>
&lt;fremy> emilio: if there is a longhand which you cannot serialize in any way, I think this can yield to problems<br>
&lt;fremy> myles: what about shorthands?<br>
&lt;fremy> emilio: but authors can limit themselves to longhands<br>
&lt;fremy> myles: but if they use the longhand, it still does not roundtrip<br>
&lt;fremy> emilio: I think it would be bad to not have a value for this<br>
&lt;fremy> emilio: to me, this seems reasonable<br>
&lt;fremy> emilio: that said, how would you describe the color space interpolation<br>
&lt;fremy> emilio: if you have the function, you can add parameters<br>
&lt;chris> I agree that is is important that this animation fits the general CSS animation model. It also means scripts using web animations will work with this<br>
&lt;fremy> drott: like I said, you only that if you need to downgrade the color space<br>
&lt;fremy> drott: by default, we will do the highest quality interpolation<br>
&lt;TabAtkins> yeah, a lab vs lch interpolation is still useful to switch while still being high-quality<br>
&lt;fremy> emilio: or change the type of interpolation (hsl, or sRGB)<br>
&lt;TabAtkins> and in lch, controlling interpolation direction is important<br>
&lt;fremy> emilio: it feels a bit not-amazing<br>
&lt;fremy> drott: we could standardize this<br>
&lt;astearns> ack dbaron<br>
&lt;emilio> q+<br>
&lt;fremy> dbaron: I just wanted to agree that having some sort of value to represent the interpolated value is what you need to do to fit the model of CSS Animations<br>
&lt;ntim> +1 to dbaron and emilio<br>
&lt;fremy> dbaron: and not having this convertable to a string would be unique<br>
&lt;TabAtkins> (We have one example of an unrepresentable computed value right now - some transforms can trigger this. We invented mix() specifically to solve that case.)<br>
&lt;chris> +1<br>
&lt;fremy> dbaron: and that would break many assumptions<br>
&lt;fremy> miriam: are we moving towards a resolution here?<br>
&lt;fremy> emilio: just need a follow-up<br>
&lt;fremy> emilio: do we believe that people will want to do the color space change<br>
&lt;TabAtkins> If needed, we can resolve "add palette-mix(), but might change our mind after our later discussion on mix() itself"<br>
&lt;fremy> emilio: can we add a new argument for that?<br>
&lt;miriam> q?<br>
&lt;miriam> ack emilio<br>
&lt;fremy> emilio: in your animation, you could specify from and to that way<br>
&lt;fremy> chris: I think people like to have the flexibility, and I would prefer to keep it<br>
&lt;fremy> emilio: but are we expecting people to use this? do we really need it?<br>
&lt;fremy> chris: you would also animate ... currentColor ...<br>
&lt;fremy> astearns: we don't have time to go into another rabbit hole<br>
&lt;fremy> myles: ok, I'm not going to stand in the way<br>
&lt;fremy> drott: can we take a resolution to take up the PR?<br>
&lt;ntim> proposed: add palette-mix(), bikeshed on the issue about the interpolation color space<br>
&lt;fremy> astearns: I think this is the right approach<br>
&lt;fremy> emilio: I would like to resolve we need a value for this<br>
&lt;fremy> emilio: but maybe we could still bikeshed the details of the value<br>
&lt;fremy> ntim: I pasted a proposed resolution<br>
&lt;TabAtkins> Yeah I'd prefer to not have a PR floating<br>
&lt;fremy> chris: can we do this by landing the PR and opening a new issue?<br>
&lt;fremy> miriam: ok, so, landing the PR and keep bikesheeding?<br>
&lt;fremy> RESOLVED: add palette-mix(), bikeshed on the issue about the interpolation color space<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8922#issuecomment-1720930646 using your GitHub account


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

Received on Friday, 15 September 2023 09:03:04 UTC