Comments (11)
Okay. I think I’ll just keep everything existing as-is, improve the documentation, and introduce:
- d3.luv = CIELUV
- d3.lchuv = CIELCh_uv
- d3.xyz = CIEXYZ
from d3-color.
I’m leaning towards the names d3.lab (CIELAB), d3.luv (CIELUV), d3.xyz (CIEXYZ), d3.lchab (CIELCh_ab), d3.lchuv (CIELCh_uv), and the corresponding d3.interpolate* methods (though I’m not sure I’ll bother with d3.interpolateXyz, as I’m only exposing d3.xyz for people that are interested in the internals of the CIE color spaces).
This would deprecate both d3.lch and d3.hcl in favor of d3.lchab.
How does that sound?
from d3-color.
should redefine
d3.hcl
as polar CIELUV
Please don’t do this; it is horrendously confusing. Use names like d3.cieluv_hcl
or d3.cielab_lch
if you want. Personally I would strongly recommend using the same input order for both. Just because R has picked a bad convention doesn’t mean it should be widely copied.
The names ‘HCL’ and ‘LCH’ have no standard meaning. (Aside: usually the “h” is written in lower case in color science literature; it’s not exactly clear why. So people often write LCh or similar.)
(It IMO also doesn’t really ever make sense to use CIELUV or XYZ in data visualizations. If you add these, you might want to warn people away from using them.)
from d3-color.
Okay. I think I’ll just keep everything existing as-is, improve the documentation, and introduce:
- d3.luv = CIELUV
- d3.lchuv = CIELCh_uv
- d3.xyz = CIEXYZ
Please also include the d3.lchab (CIELCh_ab)
alias that you mentioned in your earlier proposition.
This will provide explicitness & result in more easily understandable code for those who use both lchab
and lchuv
spaces, without requiring knowledge of the historical implementations/defaults of the library.
from d3-color.
Per #84 and #51, sounds like we’d want two or possibly three for XYZ due to the choice of illuminants.
So, I think this is the latest list?
- d3.luv = CIELUV
- d3.lchab = CIELCh_ab
- d3.lchuv = CIELCh_uv
- d3.xyzd65 = XYZ D65
- d3.xyzd50 = XYZ D50
- d3.lch = alias for d3.lchab
- d3.hcl = alias for d3.lchab with arguments in reverse order
- d3.xyz = alias for d3.xyzd65?
from d3-color.
https://observablehq.com/@mbostock/luv-and-hcl
from d3-color.
Aside: While CIELUV doesn’t really have any practical purpose nowadays, the (u′, v′) chromaticity diagram does continue to be useful, superior to the (x, y) chromaticity diagram.
from d3-color.
Wouldn't it be easier for everyone if d3.lch
would just continue to exist as d3.lchab
alias?
from d3-color.
I’m only planning on deprecating, not removing. We could keep d3.lch (non-deprecated) as CIELCh_ab, but the point is that it would be ambiguous and inconsistent if we also have CIELCh_uv as d3.lchuv. Though if CIELCh_ab is the “recommended” CIELCh, then it might make sense to leave it as d3.lch…
from d3-color.
That sounds clearer. If you use lch
as an alias for CIELAB LCh that is also generally not too bad, as CIELAB is very widely used. I was mostly worried about is confusion of lch
vs. hcl
meaning totally different things.
from d3-color.
Sorry, only just noticed this. @jrus wrote:
(Aside: usually the “h” is written in lower case in color science literature; it’s not exactly clear why. So people often write LCh or similar.)
This is because h is an angular measure, and in color difference formulae which start from LChab (starting with ΔE CMC, then ΔE 94 and ΔE2000) h is turned into a length measure H by calculating the length of the angular arc, which involved the (mean) Chroma and the hue angle. It then makes sense to add it's square to the squares of the Chroma and Lightness lengths.
So h vs. H solves the "which H are we talking about here" and is mainly interesting to people discussing the implementation details of color differences; for everyone else (especially people already using H in HSL to mean an angular measure) LCH seemed just fine, which is why CSS Color 4 used that.
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.