Git Product home page Git Product logo

Comments (6)

claviska avatar claviska commented on July 23, 2024

I'm pretty sure this is a rounding error in the hsb2rgb method. You can't type in 176fc9 either, as the same conversion is done on blur.

For my personal notes, the best way to approach this is probably storing the HEX value instead of the HSB value as INPUT data. This will prevent multiple conversions and ensure the selected color is always the same as the INPUT's HEX value.

from jquery-minicolors.

billsaysthis avatar billsaysthis commented on July 23, 2024

Sorry, I'm not well versed on color math; all I know is that #176fc9 is the color specified by our visual designer and not how to convert that to HEX or HSB and especially not why these functions would introduce rounding errors.

from jquery-minicolors.

ruiyang avatar ruiyang commented on July 23, 2024

Hi, we also got this issue.
But I am not an expert in hsb rgb conversion. I tried to fix it but no failed. Could you tell me if there is any easy workabound?

from jquery-minicolors.

claviska avatar claviska commented on July 23, 2024

I'm going to try to get this taken care of this week. There's no reason it should be saving the HSB value as data instead of the HEX value. Changing this throughout the plugin will resolve the issue.

from jquery-minicolors.

claviska avatar claviska commented on July 23, 2024

This issue has been resolved. I'll push the update shortly.

from jquery-minicolors.

claviska avatar claviska commented on July 23, 2024

The update that I just pushed changes the way opacity is enabled. The plugin will automatically detect if you have a data-opacity attribute on the input element. This will no longer work:

$('.picker').miniColors({
    opacity: true
});

You'll need to add the data-opacity attribute on your input element:

<input type="text" name="color" value="#fff" data-opacity=".5" />

The value and opacity methods still work, or you can check the value and data-opacity attributes directly.

from jquery-minicolors.

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.