Working with Color | D3 | Observable
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
Author
Mike Bostock
@mbostock
Visualization toolmaker. Founder
@observablehq
. Creator
@d3
. Former
@nytgraphics
. Pronounced BOSS-tock.
Comments (4)
Stephanie Tuerk
Apr 5, 2021
Quick question: is it intentional that d3.hsl() returns a NaN value for the 'h' property if a gray hex value is entered? See for example d3.hsl('#dedede');
Mike Bostock
Apr 5, 2021
Yes, see
https://observablehq.com/@d3/achromatic-interpolation
Stephanie Tuerk
Apr 5, 2021
thank you!
Reply
David Kirkby
May 30, 2021
Is it possible to get the opacity added as a 4th hex value?
Reply
Add comment
Subscribe to notifications
© 2026 Observable, Inc.
Terms of service
Privacy policy
Product
About
Pricing
Documentation
Release notes
Contact us
Open source
Notebook Kit
Plot
D3
Community
Public
Forum
Bluesky
YouTube
X
Observable
Sign up
D3
Mike Bostock
120
Reply
Reply
Add comment
Subscribe to notifications
130
Working with Color | D3 | Observable