Re: [csswg-drafts] [css-color-4] Color modifications proposal: extending color functions (#3187)

The CSS Working Group just discussed `Color Stuff`, and agreed to the following:

* `RESOLVED: Put all the proposals into css-color-5, ChrisL and future Una as editors`
* `RESOLVED: Rename to put 'color' first, adjust-color -> color-mod()`
* `RESOLVED: Add color-contrast() without currentbg`
* `RESOLVED: Add color-mix(), try to align with cross-fade()`
* `RESOLVED: Put both color adjustment proposals into css-color-5, with keywords instead of css-color-5`
* `RESOLVED: Add Lea Verou as editor of css-color-5`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Color Stuff<br>
&lt;AmeliaBR> s/Color Stuff/Color modification functions/<br>
&lt;chris> github: https://github.com/w3c/csswg-drafts/issues/3187<br>
&lt;fantasai> una: Chatting with TabAtkins and my team about color modification b/c very highly requested<br>
&lt;fantasai> una: Used a lot in preprocessors<br>
&lt;AmeliaBR> Una's proposal: https://gist.github.com/una/edcfa0d3600e0b89b2ebf266bf549721<br>
&lt;fantasai> una: Very common pattern, so wanted to revisit as native CSS<br>
&lt;fantasai> una: Here's a proposal for a more simplified proposal<br>
&lt;fantasai> una: based on three functions<br>
&lt;fantasai> una: adjust-color(), mix-color(), and contrast-color()<br>
&lt;fantasai> una: color adjustment is basic modification via hcl values<br>
&lt;fantasai> una: first arg is color to adjust, then list of modification functions<br>
&lt;fantasai> una: mix-color mixes two colors<br>
&lt;fantasai> una: contrast-color, submit a bgcolor and then list of color values<br>
&lt;fantasai> una: that you would place as text and background, and picks the highest contrasted color<br>
&lt;fantasai> una: HCL would be default color space<br>
&lt;fantasai> una: can also have color space argument<br>
&lt;fantasai> una: lightness in LCH vs HSL<br>
&lt;fantasai> una: If using lightness in a color space in e.g. cmyk, then do transformation in LCH and then clipped to CMYK range<br>
&lt;fantasai> una: Wanted to make easy to use<br>
&lt;fantasai> chris: Like picking LCH by default because it ... gamut<br>
&lt;fantasai> chris: result will always be a color<br>
&lt;fantasai> chris: like that it's explicit about color space<br>
&lt;fantasai> chris: Does mix up in what color space doing calc and what you revert to<br>
&lt;fantasai> chris: Gave some comments on this<br>
&lt;fantasai> chris: slightly concerned that ppl will believe that lightness = bright ness and chroma = saturation<br>
&lt;fantasai> chris: Need to understand that ...<br>
&lt;fantasai> chris: Like that we have mixing colors, pretty convenient<br>
&lt;fantasai> chris: I do this often by putting colors on a gradient to find a color in between<br>
&lt;fantasai> chris: Unsure about ...<br>
&lt;fantasai> chris: Contrast color, I like that. Saw ppl asking for conrast things<br>
&lt;fantasai> chris: But often they're asking for ...<br>
&lt;fantasai> chris: Finding most contrasty color is nice<br>
&lt;fantasai> chris: ....<br>
&lt;fantasai> chris: I do like the idea of having a thing called currentBackground that we can use elsewhere<br>
&lt;fantasai> chris: Lea points out that once you have opacity, you have ranges of contrasts<br>
&lt;tantek> currentbgcolor<br>
&lt;astearns> s/unsure about .../unsure about mixing by component/<br>
&lt;fantasai> leaverou: What do you do about ranges that are overlapping?<br>
&lt;fantasai> una: Transparency issue is still unsolved by dev tools and a11y<br>
&lt;fantasai> una: so don't know how best to handle that<br>
&lt;fantasai> una: but still creating contrast checkers in devtools and other things, can re-use technology<br>
&lt;fantasai> una: pick best color<br>
&lt;fantasai> una: up to author to make sure it contrasts enough<br>
&lt;fantasai> leaverou: not deal breaker, many ways to specify<br>
&lt;fantasai> leaverou: just something that needs to be addressed<br>
&lt;AmeliaBR> s/asking for .../asking for the ability to tweak their preferred color to meet minimum contrast requirements/<br>
&lt;fantasai> una: background with rgba have a difficulty<br>
&lt;fantasai> leaverou: can also have semitransparent text, though<br>
&lt;heycam> q+<br>
&lt;fantasai> chris: I think it's an interesting proposal<br>
&lt;fantasai> chris: lots of details to tweak, but overall it's nice<br>
&lt;Rossen_> q?<br>
&lt;fantasai> chris: also clamping needs to be defined<br>
&lt;fremy> q+<br>
&lt;fantasai> chris: ...<br>
&lt;fantasai> una: I think we could .. with filter now, brightness/saturation<br>
&lt;fantasai> una: I like unclamped<br>
&lt;fantasai> una: can use value of 1000<br>
&lt;fantasai> una: creates interesting effects in CSS that wouldn't otherwise be possible<br>
&lt;fantasai> chris: Clamping should be done at last possible moment<br>
&lt;chris> q?<br>
&lt;fantasai> leaverou: Let's discuss other proposal too so that we can compare. Might end up with blend of both<br>
&lt;astearns> ack heycam<br>
&lt;fantasai> heycam: overall I like the idaea of color adjustment things<br>
&lt;fantasai> heycam: one comment about syntax for mix-color, for images we have the cross-fade function<br>
&lt;fantasai> heycam: so if we only want one axis of interpolation, should aign the syntax wth that<br>
&lt;fantasai> heycam: this kind of liear interpolation is something ppl want for other numeric tpes as well<br>
&lt;fantasai> heycam: e.g. interpolation of lenghts<br>
&lt;fantasai> heycam: so maybe generic way for different types, or separate thing for color<br>
&lt;fantasai> TabAtkins: We have outstanding rsolution for generic interpolate() function<br>
&lt;fantasai> TabAtkins: but mix-color can do more than simple interpolate<br>
&lt;fantasai> TabAtkins: mix-color can mix different aspects of the color, pay attention to opacity or not, so much more complicated than other tpes<br>
&lt;fantasai> AmeliaBR: For mix-color, heycam talking about cmparison with cross-fade<br>
&lt;fantasai> AmeliaBR: A comparison I think of is blend-modes<br>
&lt;fantasai> AmeliaBR: The efault mixture of two colors is equivalent ot normal blend more<br>
&lt;fantasai> AmeliaBR: to exten there's a % adjustment, that's adjusting opacity of the top blend layer<br>
&lt;fantasai> AmeliaBR: Instead of talking about blending two colors using certian channels, maybe mixing using different blend modes is a way to go<br>
&lt;fantasai> AmeliaBR: But general rule is re-use existing concepts in CSS as much as possible<br>
&lt;fantasai> una: really like idea of thinking as blend modes<br>
&lt;fantasai> una: agree that re-using concepts can be nice here<br>
&lt;astearns> ack fremy<br>
&lt;chris> s/asking for .../asking for a 4.5:1 ratio to pass WCAG/<br>
&lt;fantasai> fremy: I was wondering about the color-conrast function<br>
&lt;fantasai> fremy: mainly I'm trying to understand how to use in application<br>
&lt;fantasai> una: Used for a11y if you have reusable elements<br>
&lt;fantasai> una: or dark mode<br>
&lt;fantasai> una: if you switch from light pink bg to dark purple bg<br>
&lt;fantasai> una: need to ensure conrast<br>
&lt;fantasai> una: only have to specify colors one time<br>
&lt;fantasai> una: it'll update the color on top of the background<br>
&lt;fantasai> una: common thing from SASS that ppl love<br>
&lt;fantasai> TabAtkins: crude example here: text is black or white depending on bg in this color palette<br>
&lt;fantasai> leaverou: use case right there on github with labels, can give your labels custom bg colors, and GH picks text color to contrast sufficiently -- automatically do that with contrast-color()<br>
&lt;fantasai> fremy: Now I understand the use case, label use case is very clear<br>
&lt;fantasai> AmeliaBR: One thing about the way una describe diferent from conrast function previously<br>
&lt;fantasai> AmeliaBR: previous contrast function, you gave a fixed color and a 2nd color and then a desired contrast ratio<br>
&lt;fantasai> AmeliaBR: and it adjusted 2nd color to meet the contrast ratio<br>
&lt;fantasai> AmeliaBR: As I understand deciding the correct math for that wasn't satisfactory<br>
&lt;fantasai> AmeliaBR: Una's proposal the website author has to give a palette list<br>
&lt;fantasai> AmeliaBR: would just select best contrast from list instead of calculating adjustments<br>
&lt;fantasai> AmeliaBR: could default to black/white<br>
&lt;fantasai> chris: Advantage is end up with a color provided by author rather than random color<br>
&lt;fantasai> leaverou presents alternate proposal<br>
&lt;una> https://github.com/w3c/csswg-drafts/issues/3187#issuecomment-499126198<br>
&lt;leaverou> https://github.com/w3c/csswg-drafts/issues/3187#issuecomment-499126198<br>
&lt;fantasai> leaverou: this is just about color adjustment<br>
&lt;fantasai> leaverou: problem with color-mod was it only worked in rgb<br>
&lt;fantasai> leaverou: Nowadays ppl use ? gamma monitors<br>
&lt;AmeliaBR> s/? gamma/wide gamut/<br>
&lt;fantasai> leaverou: ppl use terrible hacks by putting things into different variables and stringing together and stuff<br>
&lt;fantasai> leaverou: They've used ? in PostCSS, implemented in custom scripts, etc.<br>
&lt;fantasai> leaverou: Really need to settle on something whether this or Una's proposal<br>
&lt;fantasai> leaverou: THis proposal is based on fact that we have a number of color functions<br>
&lt;astearns> s/used ?/used color-mod()/<br>
&lt;fantasai> leaverou: besides rgb() and hsl(), also have lab() and ?<br>
&lt;AmeliaBR> +100 to we need color modification functions (of some syntax)!!!<br>
&lt;fantasai> leaverou: Every color adjustment can be described as djusting channels on one of those functions<br>
&lt;fantasai> leaverou: Instead of creating colors, augment by introducing a coor argument on each of them<br>
&lt;fantasai> leaverou: so either set coordinates specifically or use calc()<br>
&lt;fantasai> leaverou: could also use an underscore to say that this component stays the same<br>
&lt;fantasai> leaverou: so making lighter, use lch, multiply lightness by 1.2 would make it lighter<br>
&lt;fantasai> leaverou: benefit of this is that every color function gives us extra djusters for free<br>
&lt;fantasai> leaverou: Easy to understand b/c uses existing color functions<br>
&lt;fantasai> leaverou: Let's say you have cmyk() space, comes with its own adjusters<br>
&lt;fantasai> leaverou: also allows adjusting alpha<br>
&lt;fantasai> leaverou: re-uses existing syntax, the adjustment just uses calc()<br>
&lt;fantasai> leaverou: obivous what the math is<br>
&lt;fantasai> leaverou: Drawback is that it might give authors too much rope<br>
&lt;fantasai> leaverou: they might just use hsl because familiar<br>
&lt;fantasai> leaverou: Una's proposal uses lch(), which does the right thing by default<br>
&lt;fantasai> leaverou: but worries me, e.g. doesn't have alpha<br>
&lt;fantasai> leaverou: what more is it missing, that we need to add?<br>
&lt;fantasai> leaverou: if we add 10 different keywords, then gets too big<br>
&lt;fantasai> leaverou: the only benefit is very clear what the target color space is<br>
&lt;fantasai> leaverou: Obvious when you convert colors<br>
&lt;fantasai> leaverou: clear what's going on<br>
&lt;fantasai> leaverou: but it's also more complex<br>
&lt;fantasai> leaverou: clarity comes at a cost<br>
&lt;fantasai> chris: I like being explicit about the color space of computation and result<br>
&lt;fantasai> chris: converting from starting not hard<br>
&lt;fantasai> chris: _ is awkward, but might be familiar to ppl using SASS etc, where they construct the result bit by bit<br>
&lt;fantasai> chris: Also like using calc()<br>
&lt;fantasai> chris: You could do all sorts of interesting things with calc(), so that's  astrength<br>
&lt;fantasai> chris: if we do get on to cmyk and 7-color printing, hexachrome<br>
&lt;fantasai> chris: we don't have to invent new things<br>
&lt;fantasai> chris: we just get them for free because it's whatever position it is in the synta already<br>
&lt;fantasai> chris: but...<br>
&lt;fantasai> chris: Una's proposal does 3 things and each function<br>
&lt;fantasai> chris: Your proposal does only one thing, doesn't do the other two<br>
&lt;fantasai> chris: The color functions become extremely complicated syntactically<br>
&lt;fantasai> chris: First thought was I didn't like this because looked complicated<br>
&lt;fantasai> chris: I would like to dive more into what serialization is<br>
&lt;fantasai> chris: in general need to understand what serialization is and what's stored in DOM<br>
&lt;fantasai> chris: Right now colors are stored as sRGB and that's it<br>
&lt;fantasai> chris: Everyone that's seen the color spec, yeah this is good, have LCH and ICC colors<br>
&lt;fantasai> chris: high dynamic range etc. solved problem, doing this the right way<br>
&lt;fantasai> chris: But interested in how browsers are going to add this<br>
&lt;fantasai> chris: So would like to hear comments from implementers<br>
&lt;fantasai> chris: Both of these also depend on existing color functions, so need implementers to comment on that too<br>
&lt;fantasai> leaverou: both of these would require implementation of LCH<br>
&lt;fantasai> AmeliaBR: Do any browsers have work on the way to implement more advanced color spaces?<br>
&lt;fantasai> TabAtkins: Don't have work on it, but also LCH is only matrix-math different from sRGB, so not hard, just need some engineering time<br>
&lt;fantasai> chris: All the matrix math is in the spec<br>
&lt;fantasai> chris: also don't have to implement it like that, can also use ICC or color sync<br>
&lt;fantasai> chris: does all that as well<br>
&lt;fantasai> AmeliaBR: Lea's syntax can be implemented in parallell, since still get adjustments on rgb and hcl, just that the best artistic results come from lab or lch<br>
&lt;fantasai> leaverou: If HSL adjuster is implemented first and then LCH later, then more likely that existing designers will use HSL even though it's not as good<br>
&lt;fantasai> fremy: well it works for them<br>
&lt;fantasai> chris: It works for them because it's the only tool they have<br>
&lt;fantasai> TabAtkins: If you have boht, there's no reason to use HSL, LCH is wayyyy better<br>
&lt;fantasai> TabAtkins: Only reason to include older worse ones is compatibility with existing color systems<br>
&lt;fantasai> TabAtkins: but want to make using the good function the easy pasth<br>
&lt;myles_> q+<br>
&lt;fantasai> TabAtkins: so ppl use it and get happy results<br>
&lt;fremy> (to correct the notes, I just said that if designers end up using it, that means it worked for them, if the result isn't good enough, they can learn how to improve)<br>
&lt;fantasai> una: Problem with Lea's proposal is harder to understand what's going on<br>
&lt;fantasai> una: Harder to follow what's happening<br>
&lt;fantasai> una: Taking concepts of ?, transformation space, and output clipping<br>
&lt;fantasai> una: then build on that<br>
&lt;fantasai> leaverou: That's what I was wondering about as well<br>
&lt;fantasai> leaverou: ? lightness and hue cover a large percentage of cases. Unsure about individual color channels<br>
&lt;fantasai> leaverou: SASS has these, wondering if we can get usage stats<br>
&lt;fantasai> leaverou: See how many ppl need them and what use cases are<br>
&lt;una> s/concepts of ?/concepts of color space transform + set clipping space<br>
&lt;fantasai> leaverou: most use cases I've come across are saturation and lighness<br>
&lt;una> s / concepts of ?/concepts of color space transform + set clipping space /<br>
&lt;astearns> ack myles_<br>
&lt;fantasai> chris: Making a color "more green" is a bit straightforward in rgb, but going towards blue-gree... makes more sense to give a target color and go closer to that<br>
&lt;fantasai> chris: Myles, you're building on top of ColorSync, would be interested in what would be hard to do easy to do etc.<br>
&lt;fantasai> myles_: not prepared to answer that<br>
&lt;fantasai> leaverou: Issue with 2nd one beign underscores, could be some keyword or whatever.<br>
&lt;fantasai> leaverou: was an underscore only beause avoids conflicts within color function<br>
&lt;fantasai> astearns: Anyone from implementers with enough color experience?<br>
&lt;fantasai> AmeliaBR: Reminder that use cases for color modicifcation is increasing steadily<br>
&lt;fantasai> AmeliaBR: FIrst with custom properties<br>
&lt;fantasai> AmeliaBR: You can't do it in the preprocessor, has to be in the browser to work with dynamic colors<br>
&lt;fantasai> AmeliaBR: going into dark mode and using system colors, don't have concrete color to manipulate<br>
&lt;fantasai> AmeliaBR: need to do dynamically in the browser<br>
&lt;fantasai> una: contrast-color important for dark mode especially<br>
&lt;fantasai> una: these work hand in hand with changing technology being implemented in browsers now<br>
&lt;fantasai> heycam: One other syntax comment -<br>
&lt;fantasai> heycam: In 1st proposal, have adjust-color(), but we have a color-adjust property...<br>
&lt;fantasai> AmeliaBR: Could go back to color-mod()<br>
&lt;fantasai> TabAtkins: Also switch it to color-mix()<br>
&lt;fantasai> ?: And color-contrast() to match<br>
&lt;fantasai> astearns: Comment about Una's proposal requiring LCH ...<br>
&lt;fantasai> astearns: ...<br>
&lt;AmeliaBR> s/?/heycam/<br>
&lt;fantasai> astearns: Want to reserve the default for LCH, require a color space until LCH is around, then allow that to be dropped<br>
&lt;fantasai> TabAtkins: I object<br>
&lt;fantasai> TabAtkins: I don't think the LCH part is the engineering blocker<br>
&lt;fantasai> TabAtkins: They're both relatively easy thing that just need effrot<br>
&lt;fantasai> TabAtkins: getting it right the first time<br>
&lt;fantasai> TabAtkins: if someone wants to impelment adjust-color(), then doing LCH also isn't hard<br>
&lt;fantasai> dbaron: Implementing color modification functions seems significantly mroe work than implementing LCH<br>
&lt;fantasai> markus: ... Adjustment of image color<br>
&lt;myles> q+<br>
&lt;fantasai> chris: Ther'es a longrunning FF bug about ICC and imgaes, maybe just for raster images?<br>
&lt;fantasai> Markus: ? is working on image color adjustment<br>
&lt;fantasai> TabAtkins: Handling profiles but not anything else... so outputting rgb as monitor color space?<br>
&lt;fantasai> chris: Can see the difference on my screen, Chrome really gives you the desaturation , Firefox ...<br>
&lt;fantasai> heycam: Since we don't color adjust CSS colors, which aspects of these proposals would not be possible ?<br>
&lt;fantasai> TabAtkins: none, just do the math<br>
&lt;fantasai> TabAtkins: If you have badly-adjusted colors mixed with other colors<br>
&lt;fantasai> TabAtkins: In a consistent color space, get better colors later<br>
&lt;fantasai> Markus: Nothing hard in the spec from my perspective<br>
&lt;fantasai> markus: Hard part is Firefox doing color management in the first place<br>
&lt;TabAtkins> s/mixed with other colors/mixed with other colors, you have a problem, but/<br>
&lt;fantasai> markus: I don't know about parsing / serialization, but in terms of spec hard part is just finding the right syntax<br>
&lt;fantasai> AmeliaBR: Rendering resulting color is a separate, but result of these functions is going to be another oclor function using exisitng color function syntax<br>
&lt;fantasai> AmeliaBR: question of what do we do about Browsers trying to squish color functiosn into hex codes when requesting coptued style<br>
&lt;fantasai> AmeliaBR: but that's an issue with all advanced gamut<br>
&lt;fantasai> chris: It's even an issue with sRGB<br>
&lt;AmeliaBR> s/gamut/gamut color functions/<br>
&lt;fantasai> chris: If you go into wide gamut or high gamut, not enough storag<br>
&lt;chris> q?<br>
&lt;AmeliaBR> s/storag/storage/<br>
&lt;chris> ack myles<br>
&lt;mstange> q+<br>
&lt;fantasai> leaverou: Tab, you said that colors mixed being in same color space... do  you mena can't mix colors from different spaces?<br>
&lt;fantasai> TabAtkins: When mixing colors from differnet spaces and no color managing<br>
&lt;fantasai> TabAtkins: Then colors that look like they match won't later once you fix<br>
&lt;fantasai> TabAtkins: but if define the mixing color space then it's OK<br>
&lt;fantasai> AmeliaBR: If you have an imge that uses a color properly calibrated red<br>
&lt;fantasai> AmeliaBR: andyou have an uncalibrated red in your CSS, then your color scheme will look bad<br>
&lt;fantasai> TabAtkins: Used to be that RGB 255,0,0 in an image could look dfferent from red in CSS<br>
&lt;fantasai> dbaron: depending on whether image had color profiel data<br>
&lt;fantasai> una: You can mix colors from different spaces, have to speicfy mixing color space<br>
&lt;fantasai> leaverou: Would be nice to have defaults so that you don't have to speficy if you don't want to<br>
&lt;fantasai> leaverou: e.g. default to LAB<br>
&lt;fantasai> leaverou: if they're not in the same space<br>
&lt;fantasai> TabAtkins: One aspect of mixing proposal is nice to mix a single channel<br>
&lt;fantasai> TabAtkins: NOt directly interpolation<br>
&lt;fantasai> chris: That is an advantage of Una's proposal<br>
&lt;fantasai> chris: You could have a profoto RGB color and an adobe RGB color and ????<br>
&lt;TabAtkins> s/????/mix the lightness of them, which neither color space has/<br>
&lt;fantasai> myles: In first propsoal, contrast-color is different from first two otpions<br>
&lt;fantasai> myles: contrast-coor might be unimplementable depending on composting and how far back you have to go back through to find the bg color<br>
&lt;fantasai> myles: and if you don't punch through, kinda useless<br>
&lt;fantasai> TabAtkins: I don't think punching layers is good, problematic for implementations<br>
&lt;fantasai> TabAtkins: have to be in a reasonable situation like bg color on your element<br>
&lt;fantasai> myles: but is it good enough?<br>
&lt;fantasai> una: could require the first argument to be a solid color<br>
&lt;fantasai> dbaron: what is the computed value if you do this contrast color thing?<br>
&lt;fantasai> una: result would be a color<br>
&lt;fantasai> dbaron: in terms of CSS computed value, how is contrast-color going to inherit?<br>
&lt;fantasai> chris: I think the computed value would be the winning color<br>
&lt;fantasai> TabAtkins: It's a good question, need to figure that out<br>
&lt;astearns> q?<br>
&lt;fantasai> AmeliaBR: Question of how we dealt with currentColor -- it inherts as a keyword, and also wanted to switch the system colors to do that also<br>
&lt;fantasai> AmeliaBR: If we do that, then it would be awkward if the contrast selection is set at the body level but the actual element using that color has now the value of that varable or keyword ahs a different value<br>
&lt;fantasai> chris: If computed value is as specified ...<br>
&lt;fantasai> leaverou: Might not want a different alue on the child<br>
&lt;fantasai> dbaron: Part of my concern here is that except for this thing, it seems like the computed value can be computed to a color<br>
&lt;leaverou> s/Might not want a different alue on the child/even if it's a CSS variable, it could have a different value on the child/<br>
&lt;fantasai> dbaron: but this is the one thing in all this color adjustment stuff thats "layout"-dependent thing<br>
&lt;fantasai> TabAtkins: I don't think so... but if one of the options s currentColor or currentbg or whatever, then it's an issue<br>
&lt;chris> q?<br>
&lt;fantasai> fantasai: Systme colors also vary by element<br>
&lt;fantasai> dbaron: when you're doing style computation, you know what hte coptued value of the color property is. So you can know what currentcolor is as a color<br>
&lt;fantasai> AmeliaBR: we choose to inherit it as a keyword rather than a color<br>
&lt;fantasai> dbaron: Same for system colors. You can do the lookup<br>
&lt;fantasai> TabAtkins: Then I don't understand why other color mods are different<br>
&lt;fantasai> dbaron: I think all of that can happen in computed value<br>
&lt;chris> https://github.com/jonathantneal/postcss-color-mod-function<br>
&lt;fantasai> dbaron: The question is, is this definition of "aht is the relevant bg to contrast with", what does it depend on and is it something that can be resolved at computed value time locally?<br>
&lt;fantasai> dbaron: Or do you need to do layout to find out?<br>
&lt;fantasai> TabAtkins: Just being able to contrast with element's own background woudl be enough<br>
&lt;fantasai> AmeliaBR: I think it's better to leave out idea of "current background" rather than having overly-simplistic definition<br>
&lt;fantasai> AmeliaBR++<br>
&lt;fantasai> una: ...<br>
&lt;fantasai> una: You don't need it<br>
&lt;fantasai> emilio: You can use -webkit-text-fill-color<br>
&lt;AmeliaBR> s/.../we can leave out current background for now/<br>
&lt;fantasai> chris: If syntax is you put two colors in here, then new keyword<br>
&lt;fantasai> myles: I brought up contrast-color in order to differentiate from other functions<br>
&lt;fantasai> myles: picking between proposal A and B, contrast-color is distinct from either<br>
&lt;fantasai> myles: Ignoring it for the moment<br>
&lt;una> s/need it/need it because you can put currentColor in that slot and specify the background behind currentColor/<br>
&lt;fantasai> myles: Both of these proposals are saying here's some syntax, take the color, do  some math in a coor space, and then put it back into a color space<br>
&lt;fantasai> myles: But do designers think in that terms?<br>
&lt;fantasai> myles: Amelia said about blend modes<br>
&lt;AmeliaBR> q?<br>
&lt;fantasai> myles: Instead of describing as channels independently, maybe match ? maybe match better how designer would think about it<br>
&lt;fantasai> AmeliaBR: I don't think they're opposing concepts<br>
&lt;fantasai> AmeliaBR: I think Una's proposal had an adjust color and a mix color<br>
&lt;fantasai> AmeliaBR: I'm suggesting an adjust color using oneof these syntaxes<br>
&lt;fantasai> AmeliaBR: And a blend color<br>
&lt;fantasai> AmeliaBR: Adjust color is lighten or brighten or dullen<br>
&lt;leaverou> q+<br>
&lt;fantasai> AmeliaBR: Mix is for ppl thining more of combinin two colors<br>
&lt;fantasai> AmeliaBR: You can interpret lighten / darken as combine with white/black<br>
&lt;florian> q?<br>
&lt;fantasai> AmeliaBR: but ...<br>
&lt;fantasai> leaverou: Wrt proposal A and B<br>
&lt;fantasai> leaverou: ? doesn't have mix color or contrast color<br>
&lt;fantasai> leaverou: so it's really about picking how to do the adjustments<br>
&lt;fantasai> leaverou: lighter / darker / more opaque / more translucent / etc<br>
&lt;AmeliaBR> s/.../you can't make saturation brighter or duller that way/<br>
&lt;AmeliaBR> s/?/my proposal/<br>
&lt;fantasai> TabAtkins: We have strong existence proof that ppl do think about this in terms of color adjusters, because every preprocess has a variant of channel adjusters<br>
&lt;fantasai> TabAtkins: might not be ideal, but super common<br>
&lt;fantasai> leaverou: Wrt blending modes<br>
&lt;fantasai> leaverou: My experience is that designers how blending modes work<br>
&lt;astearns> +1 leaverou<br>
&lt;fantasai> leaverou: Every time I give a talk about them<br>
&lt;astearns> s/designers how/designers don't know how/<br>
&lt;fantasai> leaverou: ppl come up to me, I didn't understand how these work, just tried different ones to see the result<br>
&lt;fantasai> una: ...<br>
&lt;fantasai> una: You can also clikc around in devtools to see what works for you<br>
&lt;fantasai> una: A huge use case for color funcitons is to create palettes from a single source<br>
&lt;fantasai> una: so you'll still need color adjustment and not just mixing<br>
&lt;fantasai> mstange: Two existing ways to mix colors<br>
&lt;fantasai> mstange: gradients<br>
&lt;fantasai> mstange: and transitions<br>
&lt;astearns> ack mstange<br>
&lt;fantasai> mstange: Is the ? color function equivalent to what those do?<br>
&lt;fantasai> mstange: or is that something we want?<br>
&lt;fantasai> TabAtkins: we should offer one<br>
&lt;fantasai> TabAtkins:both of those interpolate in premultipled sRGB space<br>
&lt;fantasai> TabAtkins: not idea space<br>
&lt;fantasai> TabAtkins: but good to provide that so can match<br>
&lt;fantasai> una: could remove arugments of whcih manipulations, and then mix those two colors evenly by default in sRGB<br>
&lt;fantasai> AmeliaBR: Agree that if we have a default it should match default for gradients and tansitions<br>
&lt;leaverou> s/My experience is that designers how blending modes work/My experience is that designers don't really understand how blending modes work, they just try things until they get the desired result/<br>
&lt;fantasai> AmeliaBR: I would also like to define gradients and transitions to one day use other color spaces<br>
&lt;fantasai> AmeliaBR: e.g. color-interpolation from SVG whch nobody implements :(<br>
&lt;fantasai> AmeliaBR: want to say "mix in LCH"<br>
&lt;fantasai> chris: Had that in spec 10 yrs ago, had to take out<br>
&lt;fantasai> chris: Not that we contro lvia CSS, but antialiasing of forreground shape and bg shape, that also requires interpolation<br>
&lt;fantasai> chris: and that's again different<br>
&lt;fantasai> chris: but it's all linear interpolation and have to specify the color space<br>
&lt;fantasai> leaverou: Drawback to interpolation in LCH?<br>
&lt;fantasai> TabAtkins: Doesn't match<br>
&lt;fantasai> leaverou: but result is same or better?<br>
&lt;fantasai> TabAtkins: proably<br>
&lt;fantasai> markus: So if I'm shifting from red to green, do I go around the circle or through to gray<br>
&lt;fantasai> chris: L axis<br>
&lt;fantasai> chris: black is zeor<br>
&lt;fantasai> chris: 100 is reflective white<br>
&lt;fantasai> chris: on screen whatever native white is<br>
&lt;fantasai> chris: 50%  is visually midway between black and white<br>
&lt;fantasai> chris: if you move 10% it is equal -looking steps<br>
&lt;fantasai> chris: then have A and B axis which are cones from your eyes<br>
&lt;fantasai> chris: ... oppostie collor through the L<br>
&lt;AmeliaBR> s/zeor/zero/<br>
&lt;fantasai> chris: ...<br>
&lt;fantasai> chris: LCH is the polar form of that, ou have a hue angle starting from A axis and going round<br>
&lt;AmeliaBR> s/oppostie collor/opposite color/<br>
&lt;fantasai> chris: you have chroma which is like saturation but better<br>
&lt;fantasai> chris: L axis is neutral axis<br>
&lt;fantasai> chris: that's perception<br>
&lt;fantasai> chris: moving by constant amount<br>
&lt;fantasai> AmeliaBR: to ansewr your question, you're converting a color to a vector of 3-4 numbers, and then doing simple interpolation of the numbers<br>
&lt;fantasai> chris: If you itnerpolate LAB you'll get a striaght line<br>
&lt;fantasai> chris: iF you interpolate in LCH you'll also sweep through hue angle, see the rainbow<br>
&lt;fantasai> chris: if you wnat to go through gray then you want LAB<br>
&lt;astearns> q?<br>
&lt;fantasai> AmeliaBR: Can we make a resolution that we all agree color modificaiton functions are a good idea and have them?<br>
&lt;fantasai> q+<br>
&lt;fantasai> chris: I would like us to do that, actually<br>
&lt;fantasai> chris: ppl think we don't care, but we do<br>
&lt;fantasai> TabAtkins: it's just that my previous proposal sucked<br>
&lt;florian> fantasai: my suggestion would be: if we have a clear idea of which proposal we want, we should decide now, but otherwise, we can put both in the spec for now<br>
&lt;florian> fantasai: then it's not just a giant issue, we can work on it, we can iterate, and people can see what we're working on<br>
&lt;florian> chris: I like that idea, but i'd rather do it in css-color-mod-1 rather than css-color-5<br>
&lt;florian> fantasai: I think we should finish color-4 quickly, and then color-5 won't seem that far out<br>
&lt;fantasai> AmeliaBR: If color mod and LCH come togheter can be in the spec<br>
&lt;fantasai> AmeliaBR: we have two proposals right now<br>
&lt;fantasai> AmeliaBR: conrast function seem to all like thate xcept for current bg, so maybe resolve on that?<br>
&lt;fantasai> leaverou: and maybe mixing?<br>
&lt;fantasai> AmeliaBR: So maybe mix with color space option<br>
&lt;fantasai> astearns: LCH is not currently in color 4?<br>
&lt;fantasai> astearns: So could put this into color 4<br>
&lt;AmeliaBR> s/So maybe/And I recognize that blending is nice but confusing, stick with/<br>
&lt;fantasai> fantasai: I think we should put into color 5 and get color 4 into CR<br>
&lt;fantasai> chris: Implementer interest???<br>
&lt;myles_> q+<br>
&lt;astearns> ack fantasai<br>
&lt;fantasai> TabAtkins: We're done with the *spec*, we can put it into CR. Just can't go to REC because waiting for implementations.<br>
&lt;florian> fantasai: we don't want to conflict REC and CR. even if we don't have implementations, if we're done with the spec, it should go to CR<br>
&lt;florian> fantasai: and then this new stuff needs design work, so it should go in different level because we'll file issues, make big changes, etc. So new level or new module<br>
&lt;chris> s/conflict/conflate<br>
&lt;leaverou> q?<br>
&lt;leaverou> q+<br>
&lt;florian> fantasai: I'd prefer color level 5, because it really is the same scope as colors in general<br>
&lt;astearns> ack leaverou<br>
&lt;fantasai> leaverou: One issue with putting i neparate module, if we go with proposal B, it modifies the gramar of the &lt;color> functions<br>
&lt;fantasai> AmeliaBR: That's a good argument for color level 5<br>
&lt;fantasai> astearns: Chris, would you objet to css-color-5?<br>
&lt;fantasai> chris: No, and volunteer to edit<br>
&lt;fantasai> TabAtkins: I don't want to, but maybe Una?<br>
&lt;fantasai> una: sure<br>
&lt;argyle> rad!<br>
&lt;fantasai> astearns: So put some subset of these proposals into css-color-5 with Chris and future Una as editors<br>
&lt;AmeliaBR> s/i neparate/in a separate/<br>
&lt;fantasai> RESOLVED: Put all the proposals into css-color-5, ChrisL and future Una as editors<br>
&lt;fantasai> myles_: Please please please no underscores<br>
&lt;fantasai> chris: Some languages are positional, others need to name them...<br>
&lt;fantasai> TabAtkins: We have lucky thing that function name gives single-letter name of channels<br>
&lt;fantasai> TabAtkins: can use that<br>
&lt;fantasai> leaverou: but what about alpha?<br>
&lt;fantasai> TabAtkins: a<br>
&lt;fantasai> TabAtkins: but LAB?<br>
&lt;fantasai> TabAtkins: other a!<br>
&lt;fantasai> ...<br>
&lt;heycam> rbga(x, y, z, w) => rgb(calc(x + 20), 100, calc(z - 20))<br>
&lt;heycam> to name the arguments you want to use<br>
&lt;fantasai> astearns: let's resolve to put color-contrast in the spec<br>
&lt;AmeliaBR> s/TabAtkins: but LAB?/leaverou: but LAB? It has a, plus alpha.<br>
&lt;fantasai> una: Going to rename color-conrast, color-mod, color-mix<br>
&lt;fantasai> RESOLVED: Rename to put 'color' first, adjust-color -> color-mod()<br>
&lt;fantasai> RESOLVED: Add color-contrast() without currentbg<br>
&lt;leaverou> TabAtkins: why not just .2?<br>
&lt;florian> fantasai: we should make sure we align it with the syntax for crossfade<br>
&lt;florian> fantasai: ... to the extent possible<br>
&lt;fantasai> RESOLVED: Add color-mix(), try to align with cross-fade()<br>
&lt;fantasai> astearns: So two remainign option for color adjust<br>
&lt;fantasai> astearns: could put both in the draft and add an issue that we only need one of htese<br>
&lt;fantasai> astearns: or show why we need both<br>
&lt;fantasai> astearns: or decide now on which to pursue<br>
&lt;fantasai> astearns: anyone have a strong opinion which way to go?<br>
&lt;fantasai> TabAtkins: I'm reasonably leaning towards Una's proposal because I helped work on it<br>
&lt;AmeliaBR> And color-mix suggesting the name of mix() for the generic interpolation of numbers, etc.<br>
&lt;fantasai> fremy: My perspective is, Lea's proposal is very useful but believe storngly we can do that with custom functions<br>
&lt;fantasai> fremy: this is kind of math we cna do with it<br>
&lt;fantasai> leaverou: how does that work?<br>
&lt;fantasai> AmeliaBR: it's a Houdini proposal<br>
&lt;fantasai> astearns: I think that's true of all of these functions<br>
&lt;AmeliaBR> s/cna/can/<br>
&lt;fantasai> fremy: Arbitrary math it's not different from doing math in JS<br>
&lt;fantasai> fremy: but Una's proposal translates to designer vocabulary<br>
&lt;fantasai> fremy: I don't think there's value in creating a new function with special parsing etc. for math<br>
&lt;fantasai> fremy: I would prfer to do a custom function, re-use in your JS<br>
&lt;fantasai> chris: Are you arguing to remove calc()<br>
&lt;fantasai> fremy: what???<br>
&lt;fantasai> astearns: This is not a useful discussion.<br>
&lt;fantasai> leaverou: they are equivalent modifications, just syntax is different<br>
&lt;fantasai> fremy: yes, but if I have to choose between them I prefer the one more scoped to what designers use<br>
&lt;fantasai> una: my proposal is more simplified than Lea's, her's has more power<br>
&lt;fantasai> una: You have to specify each channel even if blank<br>
&lt;fantasai> una: but first proposal is simplified version, do by channel, but using keywords<br>
&lt;fantasai> fantasai: I suggest putting both in the spec, issue at top, request feedback<br>
&lt;fantasai> astearns: Useful to have both proposals in a spec where people can see them<br>
&lt;fantasai> fantasai: and also file issues, improve them, and compare the improved versions as well<br>
&lt;fantasai> astearns: arguments against?<br>
&lt;fantasai> AmeliaBR: It needs to be very cleary set out even if someone is jumping to heading in the document<br>
&lt;fantasai> AmeliaBR: so ppl following along can follow the options<br>
&lt;fantasai> Can also put the .annoying-warning there<br>
&lt;leaverou> basically to use the same example it's color-adjust(blue lightness(120%) chroma(.4)) vs lch(from blue, calc(120% * l) calc(.4 * c) h)<br>
&lt;fantasai> astearns: Also, I expect us to chose only one, but it might be that we end up with both<br>
&lt;fantasai> astearns: if we have good justification have both<br>
&lt;fantasai> una: also might be able to combine them<br>
&lt;fantasai> una: because same calculaitons, less explicitly laid out<br>
&lt;fantasai> ...<br>
&lt;fantasai> TabAtkins: lab vs alpha!<br>
&lt;fantasai> leaverou: write out 'alpha'<br>
&lt;fantasai> myles_: ?<br>
&lt;florian> +1 to putting both in color-5<br>
&lt;fantasai> astearns: My proposal is to put both proposals into css-color-5 with keywords instead of underscores<br>
&lt;fantasai> astearns: and start opening issues to discuss bits we want to modify<br>
&lt;AmeliaBR> s/?/but one is clearly more powerful than the other, it uses calc &amp; you can put anything in there. The other only does multiplications/<br>
&lt;fantasai> RESOLVED: Put both color adjustment proposals into css-color-5, with keywords instead of css-color-5<br>
&lt;florian> fantasai: are there other things we know we should put in color-5?<br>
&lt;fantasai> RESOLVED: Add Lea Verou as editor of css-color-5<br>
&lt;fantasai> Una: we're going to make it happen! As long as you make it happen, implementers :)<br>
</details>


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

Received on Wednesday, 5 June 2019 18:42:02 UTC