Giter VIP home page Giter VIP logo

Comments (3)

Munter avatar Munter commented on June 14, 2024

I'll look into it. I remember there was some special case, but it's been years since I touched that code, so I'll need to dive into it again to figure out how to handle it.

from one-color.

Munter avatar Munter commented on June 14, 2024

This seems to be a feature in the math that converts from HSL to HSV:
https://github.com/One-com/one-color/blob/master/lib/color/HSL.js#L15

The reason for it is probably that saturation is a useless dimension when lightness is zero. In that case the resulting color will be black, and the output color in the HSV space is also black. So the color is intact, but one of the dimensions simply doesn't make sense in that specific conversion and is hard reset to avoid division by zero.

I don't think there is a reasonable way to keep the information about saturation intact. Converting through rgb would yield the same result.

from one-color.

bebraw avatar bebraw commented on June 14, 2024

Thanks for looking into it. We managed to resolve the issue over at colorjoe. In this particular case it was enough to move from HSL to HSV (used by rgb picker) as the results were equivalent (we were using HSV components for modifications after all).

I guess it's safe to close this. You could add a mention about the issue to README but apart from that I can't think of anything else to do.

from one-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.