Skip to content
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

[css-color] Add industry standard color names #817

Closed
Crissov opened this issue Dec 19, 2016 · 10 comments
Closed

[css-color] Add industry standard color names #817

Crissov opened this issue Dec 19, 2016 · 10 comments
Labels
css-color-4 Current Work

Comments

@Crissov
Copy link
Contributor

Crissov commented Dec 19, 2016

Similar to #303, add other naming systems, e.g. RAL and HKS, if their licenses allow this.

See also my message to www-style from 27 July 2016.

@Crissov
Copy link
Contributor Author

Crissov commented Dec 27, 2016

For RAL, this would suggest color(RAL /* … */).

The RAL Design sub-system is an alternative (HCL) notation of LCH colors, as it seems. So it probably makes no sense to introduce a separate syntax for this, although it would be possible.

RAL <hhh> <ll> <cc> → lch(<ll> <cc> <hhh>deg)
color(RAL "000 15 00") … color(RAL "360 92 05")
color(RAL 0deg 15 00) … color(RAL 360deg 92 05)

The original RAL Classic sub-system would work with 4-digit <<number>>, but it also has localized names:

color(RAL 1000) … color(RAL 9023)
color(RAL "1000") … color(RAL "9023")
color(RAL "green beige") … color(RAL "pearl dark grey")
color(RAL "Grünbeige") … color(RAL "Perldunkelgrau")

The RAL Effect sub-system is based on a 3-digit number and another character (a digit or the letter M) , conventionally concatenated with a hyphen -. There are several ways this could be mapped to color().

color(RAL "110-1") … color(RAL "870-M")
color(RAL 110 "1") … color(RAL 870 "M")
color(RAL 110 1) … color(RAL 870 M)
color(RAL-1 110) … color(RAL-M 870)

Similarly, RAL Plastics, is just Classic or Design with an added -P. This may constitute a reason for not using lch() for Design.

color(RAL "1000-P") … color(RAL "9016-P")
color(RAL-P 1000) … color(RAL-P 9016)
color(RAL "000 15 00-P") … color(RAL "360 70 15-P")
color(RAL-P 0deg 15 00) … color(RAL-P 360deg 70 15)

@grorg
Copy link
Contributor

grorg commented Jan 11, 2017

In my opinion, the point of the color() function is mostly about allowing color-spaces. Adding more naming systems is only going to be useful if:

  • all the browsers implement it
  • the system produces colors that are visible to the majority of users

We currently have that with our AdobeRGB and Display P3 predefined spaces, to some extent. Do these other systems provide the same?

@Crissov
Copy link
Contributor Author

Crissov commented Jan 12, 2017

Every once in a while, CSS needs to add features that are not primarily intended for interactive screen-based webbrowsers.

@fantasai fantasai added the css-color-4 Current Work label Mar 30, 2017
@grorg
Copy link
Contributor

grorg commented Apr 21, 2017

This is already supported. You'd just need to provide an ICC profile for your naming scheme. Of course, you'd then need to get the browsers to support both getting external profiles and whatever the parsing of the arguments requires (you're allowed string arguments to the color function).

@grorg grorg closed this as completed Apr 21, 2017
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Industry standard color names, and agreed to the following resolutions:

  • RESOLVED: close as invalid, as you can already do this.
The full IRC log of that discussion
<dino> Topic: Industry standard color names
<dino> Github Topic: https://github.com/w3c/csswg-drafts/issues/817
<TabAtkins> TabAtkins: This already exists, no? color() accepts strings already, to refer to palette colors in an ICC profile.
<TabAtkins> ChrisL_: Yeah, crissov just needs to provide an appropriate ICC profile.
<TabAtkins> ChrisL_: And then you can do Pantone on your own as a user, rather than invoke licensing issues with browsers.
<TabAtkins> RESOLVED: close as invalid, as you can already do this.

@Crissov
Copy link
Contributor Author

Crissov commented Apr 21, 2017

Does this resolve #303 then, too?

I never thought of (scary) ICC profiles as a means to specify a palette of named colors. I have now learned that there is a NamedColor profile ‘nmcl’ in ISO 15076-1.

8.9 NamedColor profile

In addition to the tags listed in 8.2, a NamedColor profile shall contain the following tag:

  • namedColor2Tag (see 9.2.35).

NamedColor profiles can be thought of as sibling profiles to device profiles. For a given device there would be one or more device profiles to handle process colour conversions and one or more named colour profiles to handle named colours.

The namedColor2Tag provides a PCS and optional device representation for each named colour in a list of named colours. NamedColor profiles are device-specific in that their data is shaped for a particular device. There might be multiple NamedColor profiles to account for different consumables or multiple named colour vendors. The PCS representation is provided to support general colour management functionality. It is very useful for display and emulation of the named colours.

When using a NamedColor profile with the device for which it is intended, the device representation of the colour specifies the exact device coordinates for each named colour, if available. The PCS representation in conjunction with the device’s Output profile can provide an approximation of these exact coordinates. The exactness of this approximation is a function of the accuracy of the Output profile and the colour management system performing the transformations.

The combination of the PCS and device representations provides for flexibility with respect to accuracy and portability.

9.2.35 namedColor2Tag

Tag signature: ‘ncl2’ (6E636C32h)
Permitted tag type: namedColor2Type
This tag contains the named colour information providing a PCS and optional device representation for a list of named colours.

LCMS can create such ICC profiles.

@Crissov
Copy link
Contributor Author

Crissov commented May 29, 2017

The WG resolution conflicts somewhat with inline issue 9:

Decided at San Francisco to add a larger set of common predefined spaces like AdobeRGB, ProPhoto RGB, and so on. Also coated and uncoated swop, etc, etc.

A palette of named (LCH) spot colors may not constitute a color space of its own, but the first parameter to color() is not restricted to color space names anyway, even if – as @grorg believes – that was the main reason for this notation.

The specification should probably include an informative example of how this was possible, i.e. the first example in 11. Profiled, Device-dependent Colors should include a named color from an ICC profile.

Also, since browsers do not support external ICC profiles – but maybe PDF generators do or will – you cannot “already do this”, which is the very reason for rec2020 and image-p3 being predefined.

@svgeesus
Copy link
Contributor

Agreed that some examples of using named colors should be added. And yes, that was the intent of adding them - instead of a centralized list of color names, allow anyone to provide their own names. That also conveniently does not put the implementation in the critical path when some collections of names have licensing restrictions

@Crissov
Copy link
Contributor Author

Crissov commented May 30, 2017

Sadly, ICC profiles are not as easy to create as a CSS file, so someone but not "anyone" could put their list up on the web for others to reuse.

@tabatkins
Copy link
Member

When the "someone" in question is the steward of an industry-standard color profile, they can definitely produce an ICC profile file (or can employ someone who can). It's almost certain they already have, since ICC profiles are industry standards too, and used all over the place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-color-4 Current Work
Projects
None yet
Development

No branches or pull requests

6 participants