Comments (5)
Just a note for anyone doing the work on adapting this color space to d3... I believe the preferred name is now HSLuv: http://www.hsluv.org/
(I've been reading a bunch about HSLuv lately and came across this issue and wondered at first if it was referring to the same thing).
Anyway, I'm looking forward to seeing it in D3.
from d3-color.
See d3-hsv, d3-hcg and d3-cam02 for examples of how to define a new color space in D3. Iβd be in favor of a new d3/d3-husl package that implements the HUSL color space, say, ported from the reference Haxe implementation or from the earlier d3-interpolate-husl. Though, Iβd ask for a vanilla JavaScript implementation rather than CoffeeScript if you want to host it in the d3 organization.
from d3-color.
π Will try to get this up. Do you have a preference for how a PR is made since everything's broken into repos?
from d3-color.
I would start by creating a new personal repo named d3-husl d3-hsluv, then send me a note say itβs ready, and then you can transfer it over to the d3 organization and I will contribute any finishing touches.
from d3-color.
I've setup a ported version in this repo that follows the guidelines you set forward. I have work still to do but wanted to send this over to get your eyes on it.
A few questions I have.
--I have some precision issues to work out in the conversion process. I saw some use of Math.round in d3-color. I have converted some floats to 32 byte (7 decimals). Still, in the tests, I'm getting values at 1.9e-12 instead of 0. I can coerce to a rounded value but wanted to see if you had specific guidance. I can provide more context if needed.
-- I use l,u,v as the returned values and the test values rather than h,s,l. I like that it distinguishes from h,s,l but perhaps it is too cute.
--I will finish the Readme. I think some additional documentation should be written. Because this creates a perceptually uniform space, I expect some interest in it.
--I need to review Brighter/Darker
--I did not create the interpolation method like in the HSV repo. Can do so if you like.
I will add that I think we should add hpluv as well (which has uniform, non-distorted Chroma, uniform lightness, and approximate HSL hue). Once a path forward for hsluv is chosen, I'll create this next.
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 8
- 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.