Skip to content

[css-color-4] Clarify which transfer function to use for color(rec2020 ...) #5907

Closed

Description

@weinig

The normative definition for color(rec2020 ...) at https://drafts.csswg.org/css-color-4/#valdef-color-rec2020 says to use a transfer function value of 1/2.4 (with a note) whereas the sample conversion code at https://drafts.csswg.org/css-color-4/#color-conversion-code uses a different value of 0.45. (This could just an issue of updating the sample code to account for this).

A few things to note:

  • It looks like color.js (https://github.com/LeaVerou/color.js/blob/master/src/spaces/rec2020.js) uses 1/2.4.
  • From testing, it seems like CoreGraphics, the graphics library on macOS and iOS, uses the 0.45 when using the kCGColorSpaceITUR_2020 named color space. (This is not a blocker for us, I can perform the conversion manually, but it would be a bit unfortunate for CSS and CoreGraphics to disagree here, if people are trying to use color values interchangeably.)

Activity

  1. svgeesus commented on Jan 29, 2021

    @svgeesus
    Collaborator

    I was discussing this with Chris Cameron from Google earlier this week. The unreferenced quote is from BT.2020-2, Parameter values for ultra-high definition television systems for production and international programme exchange page 5, note 4. Which seems to directly contradict the table on page 4 of the same specification. The notes is not saying what is correct, but rather what is commonly done and maybe good enough.

    https://www.itu.int/rec/R-REC-BT.2020-2-201510-I/en

    Having checked BT.2020 I am comfortable removing the note and referencing BT.2020 directly. Which as you point out is what the sample code already does. So it is more a case of updating the spec to match the sample code and BT.2020

    I will update color.js to use 0.45 per spec, too.

  2. svgeesus commented on Jan 29, 2021

    @svgeesus
    Collaborator

    From testing, it seems like CoreGraphics, the graphics library on macOS and iOS, uses the 0.45 when using the kCGColorSpaceITUR_2020 named color space.

    To clarify, it uses that except for the linear portion near zero, right?

  3. weinig commented on Jan 29, 2021

    @weinig
    ContributorAuthor

    To clarify, it uses that except for the linear portion near zero, right?

    Correct.

  4. svgeesus commented on Feb 4, 2021

    @svgeesus
    Collaborator
  5. svgeesus commented on Feb 4, 2021

    @svgeesus
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted as Obvious BugfixFixed an obvious error with the obvious solution.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.css-color-4Current Work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions