W3C

CSS Color Correction Module

Editor's Draft 30 July 2012

This version:
http://dev.w3.org/csswg/css-color-correction/
Latest version:
http://www.w3.org/TR/css-color-correction/
Previous version:
http://lists.w3.org/Archives/Public/www-style/2009Nov/0226.html
Feedback:
www-style@w3.org with subject line “[css-color-correction] … message topic …” (archives)
Editors:
L. David Baron (Mozilla)

Abstract

CSS (Cascading Style Sheets) is a language for describing the rendering of HTML and XML documents. While existing specifications define the color space of colors specified in style sheets and in other resources, the rules on color space have generally not been followed, leading to avoidable differences in color between devices or implementations. This document defines a new CSS property that will help migration towards the correct handling of colors that is already defined by allowing authors to specify a preference for the correct or the traditional (device-dependent) color handling.

Status of This Document

This is a public copy of the editors' draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don't cite this document other than as work in progress.

The (archived) public mailing list www-style@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “css-color-correction” in the subject, preferably like this: “[css-color-correction] …summary of comment…

This document was produced by the CSS Working Group (part of the Style Activity).

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents


1. Introduction

This section is non-normative.

CSS Level 1 ([CSS1]), CSS Level 2 ([CSS21]), and the CSS Color Module, Level 3 ([CSS3COLOR]) define colors specified in CSS to be in the sRGB color space ([SRGB]). However, most or all existing Web browser implementations do not correct colors specified in HTML, CSS, or untagged images even when the proper correction is known.

If browsers did so, it would make the colors displayed in Web pages more consistent between different displays and operating systems. However, a more important type of consistency is the consistency of colors in different parts of a page on the same display, such as between colors specified in style sheets and colors in images, or between those colors and colors drawn by plugins. Improving the consistency of colors between different displays, therefore, requires care not to cause the worse problem of inconsistency of colors on the same display.

In the long run, we hope that it might be possible for implementations to switch to treating CSS colors and colors in untagged images as being in sRGB by default. (This may depend on additions for color management being made to the plugin API and popular plugins using those additions.) Therefore, this specification provides a way to clearly opt in to that correct behavior, but provides an default behavior (initial value) that may be equivalent to this opt-in.

2. Conformance

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (see [RFC2119]). This specification uses these words to describe either conformance requirements for style sheets or those for implementations.

Definitions of CSS properties given in this specification MUST be used by style sheets in a manner conformant to CSS 2.1 and its template for property definitions and MUST be interpreted by implementations in a manner conformant to the same (see [CSS21], particularly section 1.4.2 and chapters 4, 6, and 3).

An implementation of this specification (such as a Web browser or other CSS-based renderer) conforms to it if it meets all conformance requirements described as requirements on implementations.

A style sheet conforms to this specification if it meets all the requirements on style sheets.

An authoring tool that generates style sheets (such as an editor or style sheet generator) conforms to this specification if it generates only conforming style sheets.

3. Definitions

untagged image
... include images and canvases ... exclude SVG
untagged video
...

4. Opting in or out of color management

Name: color-correction
Value: default | sRGB
Initial: default
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

The color-correction property specifies the color space that colors specified in CSS and colors in images whose color space is undefined according to the rules for the relevant image format (untagged images) are in. It does not apply to videos, since untagged video should be presumed to be in CCIR 601. Really? Shouldn't video be consistent with images? Or do implementations really do this differently?

sRGB
Colors specified in CSS and colors in untagged images are in the sRGB color space, and implementations MUST display them accordingly.
default
The color space for colors specified in CSS and colors in untagged images is not defined. However, implementations MUST use a single color space for such colors so that they match each other. When doing so would not cause color mismatches with content such as plugins, implementations SHOULD treat ‘auto’ the same as ‘sRGB’.

The initial value of this property may change in a future level of this specification.

5. Acknowledgments

Bert Bos, Tantek Çelik, Beth Dakin, Simon Fraser, Chris Lilley, David Singer, and Henri Sivonen have given input useful to the making of this specification.

6. References

6.1. Normative

[CSS21]
Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. 7 June 2011. W3C Recommendation. URL: http://www.w3.org/TR/2011/REC-CSS2-20110607
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. Internet RFC 2119. URL: http://www.ietf.org/rfc/rfc2119.txt
[SRGB]
Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB. IEC 61966-2-1 (1999-10) ISBN: 2-8318-4989-6 - ICS codes: 33.160.60, 37.080 - TC 100 - 51 pp. as amended by Amendment A1:2003. URL: http://www.iec.ch/nr1899.htm

6.2. Informative

[CSS1]
Håkon Wium Lie; Bert Bos. Cascading Style Sheets (CSS1) Level 1 Specification. 11 April 2008. W3C Recommendation. URL: http://www.w3.org/TR/2008/REC-CSS1-20080411
[CSS3COLOR]
Tantek Çelik; Chris Lilley; L. David Baron. CSS Color Module Level 3. 7 June 2011. W3C Recommendation. URL: http://www.w3.org/TR/2011/REC-css3-color-20110607

Index

Property index

Property Values Initial Applies to Inh. Percentages Media
color-correction default | sRGB default all elements yes N/A visual