Allow non-alpha input when lockOpacity is set #275
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thatlockOpacity
andrgba
are bothtrue
, 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 properrgb()
,hsl()
, andhsv()
input functions are displayed for edit.When
lockOpacity
is set totrue
, 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.Fixes #257