simonwep / pickr

🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
https://simonwep.github.io/pickr
MIT License
4.31k stars 285 forks source link

Allow non-alpha input when lockOpacity is set #275

Closed musicfuel closed 3 years ago

musicfuel commented 3 years ago

The lockOpacity flag is useful in updating the color type buttons and restricting input to prevent changes to alpha, but doesn't appear to impact the input field for direct entry. For example, in the case that lockOpacity and rgba are both true, the button label changes to RGB as expected but the input will still display "rgba(255, 255, 255, 1)" with the alpha channel in place.

This change modifies the behavior so that the lockOpacity flag carries through to all the modes so that the proper rgb(), hsl(), and hsv() input functions are displayed for edit.

When lockOpacity is set to true, the buttons for colors with an alpha channel will still no longer show the "A" and the input will reflect a function without the "a" which is only the three primary channels. All the behavior of the input is the same, including the adjustable numbers.

Screen Shot 2021-04-28 at 9 10 37 PM

Fixes #257

simonwep commented 3 years ago

Hey, I really appreciate your PR but I consider this a feature which I don't intend to maintain anymore (see the status of this project). I'll leave it open though in case someone forks and is interested in your PR! Sorry again.

musicfuel commented 3 years ago

Thanks for getting back to me. I saw the status of the project and thought this might be the case. I need this support for an application I work on and wanted to see if it could be merged into the project itself before I go the route of forking it.

Thanks for the great work on the project!