Comments (9)
@DCtheTall not at all! I have not had the chance to put together the PR, so I'm happy to pass the baton. I have an initial implementation here, if it helps in any way.
from d3-color.
Yes, that’s a good idea. There’s a nice implementation here by Jacob Rus:
https://observablehq.com/@jrus/jzazbz
from d3-color.
I could make a PR to add support for Jzazbz.
One thing that nags me is that the color space operates CIE XYZ absolute values, and I'm not sure how to scale relative XYZ values to meet the authors' intentions and make the best use of Jzazbz (or whether the decision alters the qualities of this color space in significant ways). @jrus uses 200 cd/m2 in his notebook.
from d3-color.
@danburzo are you still working on this? If not, would you mind if I attempted a PR?
from d3-color.
I haven't forgotten about this, just been busy at work. I plan on getting to this still 😅
from d3-color.
Took a look at this today and I think the best approach is to start by separating the XYZ color space in src/lab.js
into its own module and then use that module as a dependency to reimplement src/lab.js
. It will save me having to reinvent the wheel for going to Jzazbz and use an XYZ representation that is consistent with the one already in src/lab.js
.
If that sounds like the right idea, I have a draft PR up now with this issue tagged. If there's a reason not to do this (like the XYZ space in src/lab.js
is not what we want to use here), then I'll defer to the owners on what a better path forward is.
from d3-color.
I think extracting XYZ D50 as its own color space is a useful addition to the API. However, one thing I'm not sure about, is which XYZ space should d3.xyz
point to, if any. Here are the conversions needed for Lab and Jzazbz:
- sRGB <-> XYZ (D65) <-> XYZ (D50) <-> Lab
- sRGB <-> XYZ (D65) <-> JzAzBz
In the current implementation of d3.lab, sRGB <-> XYZ (D65) <-> XYZ (D50)
is performed in a single step (using a combined matrix).
While XYZ D50 is useful for Lab/LCh and the ProPhoto RGB color space. On the other hand, XYZ D65 is useful for Jzazbz or DIN99.
from d3-color.
@danburzo thanks for the clarification between XYZ D65 and D50.
It seems to me that since D65 is actually used by multiple color space conversion methods, it makes sense from a software design perspective to refactor it out to make it reuseable.
As for whether to make XYZ D50 its own module, I'll defer that to the others on this thread. I think it probably does make sense to have it be its own module as well.
from d3-color.
@danburzo after thinking on this some, I think it makes sense to have both XYZ spaces as their own module.
As for the name, I was thinking there should be d3.xyzd50
and d3.xyzd65
, or possibly just d3.d50
and d3.d65
. I think having one be called d3.xyz
might be confusing to users?
from d3-color.
Related Issues (20)
- d3.rgb doesn't parse HSL hues with `deg` units HOT 1
- Changing color.s changes luminosity and color.l saturation.
- Security vulnerability fix for d3-color required in version 2.x HOT 7
- Security vulnerability fix for d3-color nice-to-have in version 1.x HOT 4
- Unexpected token 'export' while update from 2.x.x to 3.x.x HOT 2
- Why d3 uses illuminant D50 instead of D65? HOT 1
- d3.hsl doesnt seem to work with grey scale values HOT 2
- Alpha value of 0 breaks rgb HOT 1
- Add formatHex8() to include opacity HOT 7
- Brightening black in RGB HOT 3
- bug: hue is NaN when convert hsl HOT 2
- Unexpected conversion to HSL
- Incorrect conversion from HCL / LCH to hex or rgb HOT 2
- oklab / oklch? HOT 9
- More exports. HOT 9
- Doesn't work - color is not defined HOT 1
- Does the Common JS version of the module work? HOT 1
- Supporting CSS color level 4 HOT 3
- Avoid catastrophic backtracking when parsing HOT 11
- formatHex with alpha channel HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-color.