Code Monkey home page Code Monkey logo

Comments (5)

MalcolmDwyer avatar MalcolmDwyer commented on May 2, 2024 2

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.

mbostock avatar mbostock commented on May 2, 2024

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.

petulla avatar petulla commented on May 2, 2024

πŸ‘ 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.

mbostock avatar mbostock commented on May 2, 2024

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.

petulla avatar petulla commented on May 2, 2024

@mbostock

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.