Skip to content

[css-color-4] §10.9 example: the XYZ values for #7654CD come from the rounded lab() #14765

Closed

Description

@dy

§10.9 lists five forms of one color as exactly equivalent: #7654CD, rgb(46.27% 32.94% 80.39%), lab(44.36% 36.05 -58.99), color(xyz-d50 0.2005 0.14089 0.4472) and color(xyz-d65 0.21661 0.14602 0.59452).

The two XYZ values are not those of #7654CD. They follow from the already rounded values: the xyz-d50 is lab(44.36% 36.05 -58.99) converted and rounded, and the xyz-d65 is that rounded xyz-d50 adapted to D65.

printed computed from #7654CD
xyz-d50 0.2005 0.14089 0.4472 0.20049 0.14087 0.44708
xyz-d65 0.21661 0.14602 0.59452 0.21660 0.14600 0.59437

It is harmless on screen: the printed XYZ still round to #7654CD (117.98, 84.01, 205.02). It only shows when the example is used as a test value, as I did: Z of the xyz-d65 form is off by 1.5e-4.

Suggested fix: color(xyz-d50 0.20049 0.14087 0.44708) and color(xyz-d65 0.21660 0.14600 0.59437).

Computed with the §19 sample code's matrices and with colorjs.io 0.7.1; culori 4.0.2 and the color-space npm library, which I maintain, agree to the digits shown.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址