-
Notifications
You must be signed in to change notification settings - Fork 715
[css-color-4] Better name for gray()? #4621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You could always add rgb(n) and rgb(n/a), which seems harmless enough, but please don't drop gray() without giving a syntax that doesn't presume RGB. We've had a colorspace called "gray" in PDF/PostScript since forever, with 0=black. It's defined as the black in CMYK - so |
What about any of these:
|
I dislike most of these names, as they're misleading/weird:
I'm not sure what you mean by:
since the data shows If we did change the name, I'm okay with a 1-arg variant of an existing colorspace function, but not Another possibility, inspired by the existing (oddly named, but we're stuck with them) colorspace functions, is just A final possibility is we just drop |
Exactly. Also, the fact that 1-arg rgb() was so popular means people responding did not read, or understand, what gray() does (although what it does now and what it did at several times in the past ( I'm tempted to leave it for now, and see what happens when |
Why not have both, single-argument |
More impl and testing work for essentially zero benefit. |
I don't like single-argument
|
Of all the suggestions so far, black([percentage]) seems most reasonable and intuitive to me. I don’t consider myself a color geek, but I am a web designer and developer, a former print designer, and someone who paints occasionally. In printing with black ink, a 10% screen halftone is a very light gray, and a 90% screen halftone is a very dark gray. I also don’t think it is unusual to think of gray paints as being a percentage of black (with the rest of the mixture being white). See Exercise 2 on this page, for example: |
I need to amend my earlier comment. Single-argument It now seems most logical to me to use |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Better name for gray()?<dael> github: https://github.com//issues/4621 <dael> leaverou: gray100% is white and gray 0% is black. Everyone agreed different name <dael> leaverou: It's been a long time. I asked on twitter and my blog back then. I linked to the results <dael> leaverou: Seems most people don't find it intuitive. <dael> leaverou: People voted for simple argument rgb and gray isn't defined in rgb terms <dael> leaverou: Not sure how much we should take it into account. <dael> leaverou: I still stand by gray isn't a good name. White or black might be better. white 100% could make sense <dael> leaverou: It's being impl so change is now or never <bkardell_> should we try to do a post and evangelize with a good explanation along with the poll, just to check? <dael> AmeliaBR: Agree it's surprising at 100 but gray(70%) to talk about a gray is something I've seen in design forums. If we are switcing I would argue l or lightness instead of white or black because then we have same confusion that 0% white is black <dael> leaverou: L is good. lightness sounds like a filter, but not strong <dael> AmeliaBR: I have same, lightness is close to brightness. L would be happy for me <dael> bkardell_: Won't people ask what L means? <dael> smfr: Can't google L <tantek> what does the L in HSL stand for then? <dael> florian: Not sure it's needed, but argument against gray is that in photographic field people speak as 80% as a middle gray and they mean 50% in lab. That's the stanard gray in photography <dael> chris: They're talking about luminence <AmeliaBR> s/80%/18%/ <dael> florian: Right so if gray 18% means something else it's not nice <dael> fantasai: White and black are not much better than gray <chris> monochrome? <dael> Rossen_: If we did white or black are we signing up for both? <dael> myles: 0 means none of it. For black(0) would mean same as black(100) and so that's why I'm for white <dael> chris: What about monochrome? Makes hughless <dael> leaverou: So long <dael> florian: Any color is monochrome <smfr> s/hughless/hueless/ <chris> lab(foo% 0 0) <dael> TabAtkins: leaverou hit nail on head. Most suggestions will be longer than lab % 0 0 which is what gray does. gray isn't much of a savings. I prefer stick with gray or drop function <dael> AmeliaBR: Any syntactic problem with making 2nd and 3rd value of lab options? <dael> TabAtkins: I don't think there's precident for that <dael> florian: I like it <tantek> this sounds like a bunch of new bikeshedding and multiple options being considered that should first be added to the list in the GitHub issue comment thread rather than a phone call <dael> chris: I think will be confusing <dael> leaverou: Why privleage one coordinate? <dael> AmeliaBR: Then I would argue drop gray. As florian pointed out gray(50%) isn't want people think of as 50% in design due to color space the shorthand isn't helpful <dael> chris: Fine with that <dael> myles: lab seems worse for people that don't know colors. What does lab mean? <dael> leaverou: rgb is no more intuitive it's just been used for years <dael> AmeliaBR: But people are familiar with it I'd be happy to have a one function rgb. But let's not have gray function that doens't do what people expect <dael> Rossen_: Are we saying gray won't work as intended and will be unintuitive? <dael> Rossen_: If we discount that half the people vots for rgbx which worked at the time everyone else voted gray <dael> florian: We're defining it to work on l of lab and people mean 50% gray in srgb space. gray 15% in srgb is what people would see with 50% in lab <chris> 50% shades of gray <bkardell_> what about just mono? <dael> fantasai: If using % in lab people will think of it as the gray function no matter the name. Calling it lightness or gray or whatever will not change the effect if they're thinking in srgb. Why not call it gray? <dael> florian: Call it gray in do it in srgb <dael> fantasai: gray makes it obvious the midpoint. That's useful. People that work with gray understand white and black and near and far ends. Whatever we call it people will be disappointed because not in the color space they want <dael> myles: Maybe take an optional param <dael> fantasai: Or we do single value lab and rgb functions. THis is syntax sugar. Want to make most common thing work <dael> chris: A gray thing with an optional param to say warmer or cooler <AmeliaBR> I'd argue for both `rgb(18%)` expanding to `rgb(18% 18% 18%)` and for `lab(50%)` expanding to `lab(50% 0 0)`. Don't use `gray()` because it's not clear which one it would be. <dael> Rossen_: Since people are starting to impl let's get to a resolution or live with gray. Strong canadate names over gray? <dael> bkardell_: monochrome was too long, would mono work? <dael> TabAtkins: Don't generally go for shortening words as makes it hard to understand <dael> chris: 3 options. Drop function. Keep as gray. Rename it now. smfr is impl so can't mess around with name <dael> florian: Which gray is it? <dael> chris: L as currently spec <dael> Rossen_: Can we live with dropping? <dael> Rossen_: I will take silence as a yes <dael> bkardell_: It's less important than lab. <dael> chris: You're not losing anything <dael> Rossen_: Objections to drop gray() function <dael> RESOLVED: drop gray() function <bkardell_> we can always bring it back up <dael> Rossen_: We can go back to these argumenents if we re-introduce <dael> fantasai: Should we take up single value lab or rgb as equating to gray? <chris> noooooo <dael> TabAtkins: I don't think it's worthwile enough to take up. |
Closed in accordance with CSS WG resolution 8 Jan 2020 |
k/key was mentioned in the minutes; it's similarly wrong/misleading, as |
As far as I see, only |
Ah, it was a side comment, looks like it didn't get minuted; Chris was referring to Brad Kemper's comment about black(), suggesting that it was in fact an intuition about K, which would be slightly off for a Lab-based function just like an rgb intuition would be. |
5 years ago, I opened this mailing list issue:
There was consensus that the name needs to change, but not to what. So I started a survey, which also confirmed that the name
gray()
as a bad idea.The last post in the thread is by @tabatkins saying that "the results are impressive, let's let it run for another week and take what people decide".
Well, it ran for 5 years, and these are the results:
It looks like
rgb(<number>)
is overwhelmingly leading, but that is likely just a result of authors today being more familiar with thergb()
function. There is a famous quote (somewhat dubiously) attributed to Henry Ford: “If I had asked people what they wanted, they would have said faster horses.” The fact that RGB is not user friendly is well established in the literature, so I don't think it should be the only solution for easy specification of grayscale colors (though it may be nice to have it as an additional shortcut).Apart from that, there doesn't seem to be any clear consensus on the name, besides that
gray()
is not the best option.Renaming the function also eliminates the
gray
/grey
confusion elaborated in #3298.Since we're already working in Color 5, it would be nice to finally have a resolution on this, if it's going to be renamed.
To recap, here are some ideas for names that have been mentioned:
black()
withblack(0%)
=white
andblack(
100%) =
black`white()
withwhite(0%)
=black
andwhite(
100%) =
white`grayscale()
lightness()
darkness()
shade()
I personally feel much more strongly that
gray()
is a poor name choice than I feel that any of the above should be the one of choice. I think they're all better thangray()
. Slight preference forwhite()
as the absence of light producing black makes more sense than the absence of darkness producing white. We should also make sure that 50% is the gray that is perceptually between white and black, and not justhsl(0,0%,50%)
.Whichever name you propose, please write it out with 0%, 50%, 100% and make sure it still makes sense and reads naturally for the color it produces.
The text was updated successfully, but these errors were encountered: