Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-alpha input when lockOpacity is set #275

Closed
wants to merge 1 commit into from

Conversation

musicfuel
Copy link

@musicfuel musicfuel commented Apr 29, 2021

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 simonwep added the feature request New feature requested label May 13, 2021
@simonwep
Copy link
Owner

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
Copy link
Author

musicfuel commented May 13, 2021

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!

@musicfuel musicfuel closed this Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove alpha field from color-functions if lockOpacity is set to true
2 participants