GithubHelp home page GithubHelp logo

Comments (5)

meksor avatar meksor commented on August 25, 2024 1

Want!

from hsluv.

boronine avatar boronine commented on August 25, 2024 1

@no-identd the behavior you're seeing can be explained more simply.

Moving the slider by 1 pixel will change the hue value by 360 / slider width (px) = 360 / 161 = 2.236. The reason it appears as "snapping" is that mouse events have a pixel-level precision, so we cannot detect a subpixel mouse move. Apparently Chrome is supposed to support subpixel precision [1], but at least on my machine it doesn't (MacOS 10.13, Chrome 64). In either case, picker.js treats mouse coordinates as doubles so the code is ready as soon as support is rolled out.

I could not reproduce the issue with zooming on my machine. Could you give me specific values you are seeing as well as the browser you are using?

It seems that the general issue here can be mitigated by making the sliders wider, which would involve a slight redesign of the picker layout.

(btw, I'd love to see an HSLuv picker similar to the Adobe color wheel, but won't have time to work on it myself)

[1] https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX#Browser_compatibility

from hsluv.

boronine avatar boronine commented on August 25, 2024 1

This should do it: http://www.hsluv.org/

from hsluv.

no-identd avatar no-identd commented on August 25, 2024

Update:
In fact, it seems like the case appears even worse, the sliders seem to exhibit some weird DPI dependency? The values it snaps to and the 'snap range' seems to change depending on the zoom level of the browser...

from hsluv.

no-identd avatar no-identd commented on August 25, 2024

I had a lengthy reply to this typed out, unfortunately it died. What it boiled down to:
Independent of the subpixel precision issue, changing the slider width to 180 should improve matters greatly without messing up the website design.

from hsluv.

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.