Giter VIP home page Giter VIP logo

Comments (8)

mdbassit avatar mdbassit commented on August 22, 2024

That's probably an artifact of the rounding of the alpha value. This color picker only supports integer alpha values between 0 and 100, but the hex alpha values (which go from 0 to 255) map to decimal values which are then rounded to the closest integer value.

Could you explain how this presents a problem for you? I'd be quite surprised if anyone can tell the difference between alpha values 50 and 51, let alone 50.5!

from coloris.

AnonUsr-Dev avatar AnonUsr-Dev commented on August 22, 2024

I reported it as a issues because when creating an app for this type of conversion, only the input for the alpha channel is rounded.
If it is based on a human sense, then it is not a problem at all.
Thank you for the good color picker.
image

from coloris.

mdbassit avatar mdbassit commented on August 22, 2024

Thanks for the kind words.

By the way, the color picker already has a built-in format conversion tool that you can activate by setting the option formatToggle to true, though it doesn't support the hwb color format.

In your screenshot, what are those values in the 3rd and 4th fields?

from coloris.

AnonUsr-Dev avatar AnonUsr-Dev commented on August 22, 2024

I am aware that there are built-in conversions, but I wanted an app that could quickly and easily copy each format and also provide features like rounding to 3-digits hex values.
To achieve this, I'm using a combination of external libraries to convert the output of Coloris.
While bug-fixing in this app, I noticed an unexpected rounding behavior and was able to reproduce it using Coloris alone then i reported.

It's a very straightforward idea, but I think that by reducing the slider's step from 1 to, for example, 0.001, we can minimize the necessary changes to the current calculation function and potentially resolve this issue.

Considering that it hasn't been reported by others, it might be a niche issue.
That's why, If it's feasible, I kindly request you to please take it into consideration.
Thank you.

from coloris.

AnonUsr-Dev avatar AnonUsr-Dev commented on August 22, 2024

im not aware of the specific circumstances that led to the use of toFixed of internal alpha value, so I cannot ascertain if this is the correct fix.
However, based on my usage, I implemented the following approach for the correction, which I will provide for your reference.(AnonUsr-Dev/Coloris@0d8ca4d)

from coloris.

mdbassit avatar mdbassit commented on August 22, 2024

im not aware of the specific circumstances that led to the use of toFixed of internal alpha value, so I cannot ascertain if this is the correct fix.

The use of toFixed() to format the alpha value was a workaround to fix the bug #35, which was caused by the Chrome bug https://issues.chromium.org/issues/40824169.

It looks like the Chrome bug has been fixed around 16 months ago, so it probably safe to remove that workaround. I just need to test it to make sure there will be no regressions.

from coloris.

AnonUsr-Dev avatar AnonUsr-Dev commented on August 22, 2024

i understand, Thank you for your response to this issue.

from coloris.

mdbassit avatar mdbassit commented on August 22, 2024

I just published a new version that should fix your problem.

from coloris.

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.