d3 / d3-color

Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
https://d3js.org/d3-color
ISC License
398 stars 91 forks source link

Why d3 uses illuminant D50 instead of D65? #120

Open michkowalczuk opened 6 months ago

michkowalczuk commented 6 months ago

@mbostock , What is the reason that you decided to use illuminant D50 instead of D65 in d3?

CIE standard illuminant D65 values are:

Xn: 0.950470,
Yn: 1,
Zn: 1.088830

You use the following D50 values: https://github.com/d3/d3-color/blob/71c7f100f9fa85a1c70fcbaeb5f803ee8db5620d/src/lab.js#L7-L9

For example chrome.js uses D65: https://github.com/gka/chroma.js/blob/cd1b3c0926c7a85cbdc3b1453b3a94006de91a92/src/io/lab/lab-constants.js#L6-L9

danburzo commented 6 months ago

D50 is the illuminant used in CSS for lab() / lch() colors, as well as in graphics applications such as Adobe Photoshop. See also: https://github.com/gka/chroma.js/issues/278