w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.48k stars 660 forks source link

[css-color] Non-ICC color specifications #5737

Closed Crissov closed 2 years ago

Crissov commented 3 years ago
color() = color( [ 
    [<ident> | <dashed-ident>]? 
    [ <number-percentage>+ | <string> ] 
    [ / <alpha-value> ]? 
  ]# , <color>? )

The color() function as currently specified expects either a single color name or a sequence of numeric component values. This may well cover everything that is possible with ICC profiles, but it does not support systems which support multiple keywords to specify a single color, e.g. CNS very dark reddish orange, or combine letters/words and numeric amounts, e.g. NCS S 2030-Y90R ~ 20% 30% 10% yellow 90% red.

Should the syntax be relaxed a bit to support such systems in the future?

faceless2 commented 3 years ago

The "string" component in that grammar is the color name, so it can include spaces. But whether this grammar, which doesn't allow the amount of that named color to be specified, is the best fit for this purpose is going to depend on https://github.com/w3c/csswg-drafts/issues/2023

svgeesus commented 3 years ago

As I proposed CNS for CSS in 1996 I am familiar with it, and the barrier to adoption remains the same - a mapping from name string to Munsell colors is alluded to in the paper but is not provided. I mailed the author at the time, and did not get a response.

So (unless someone did the work to create such a mapping) there is no way to get a colorimetric value from a given name. Which makes it a poor fit for the color() function, and more akin to how device-cmyk() was until we fixed it.

Similar problems for the proprietary NCS; the colorimetric values for each color are not available.

Myndex commented 3 years ago

Hi Chris @svgeesus

So (unless someone did the work to create such a mapping) there is no way to get a colorimetric value from a given name.

RIT did, I have a spreadsheet with the Munsell renotation and transformed to a number of colorimetric values — it is attached, is this what you mean?

Let me know if you need other data sets, I have a few...

Andy real_sRGB.ods.zip

svgeesus commented 3 years ago

Thanks. I have a copy of that spreadsheet, which is becoming harder to find since http://www.cis.rit.edu/research/mcsl/online/munsell.php now just redirects to the modern RIT website which is a glossy brochure with little useful content.

Note though that this data was for Munsell; the discussion here is for the Swedish Natural Color System (NCS), and the Color Naming Scheme (CNS).

NCS®© is the registered trade name of NCS Colour AB, Sweden. You use the system by buying a printed swatchbook or a rinted atlas, choosing a color visually, and buying a new one every few years as the colors fade beyond tolerances.

There is no published algorithm, no published table of data as far as I know and being proprietary there could be legal consequences to buying one, measuring it and publishing the values. There may also be trademark aspects as well.

Myndex commented 3 years ago

Hey Chris @svgeesus

Ah okay, my mistake, I misread the thread... And yea, some of my treasure trove took a log of digging and or learning some Russian which is why I attached it... LOL.

NCS is kinda weird, and as I expressed in another...uh.. "essay" IMO W3 ought not to be supporting proprietary anything. But looking at the OP's post, not sure how this applies to ICC ?

Tangentially: I see the potential for a useful notation form though, such as L50C35h145...

Crissov commented 3 years ago

I’m just suggesting to change [ <number-percentage>+ | <string> ] to either [ <number-percentage>+ | <string>+ ] or [ <number-percentage> | <string> ]+, so it would be more versatile.

As I said, the current grammar is probably sufficient to match the possibilities of ICC profiles as currently specified.

svgeesus commented 2 years ago

The <string> part was to support ICC Named Colors, which we then removed: