pickr
pickr copied to clipboard
Remove alpha field from color-functions if lockOpacity is set to true
Bug Report
Hi there! I'm trying to disable any selection of alpha channel, our application does not support it.
I set input options like
{
lockOpacity: true,
components: {
opacity: false
}
}
This has the desired effect of suppressing UI elements for the user to use mouse for selecting transparency. Also this has the desired effect of changing button text of RGBA to RGB and HSLA to HSL.
Here are the problems that arise:
- The text input still contains
rgba()
andhsla()
functions. Expect these to only containrgb()
andhsl()
- These rgba and hsla representations do not match the text of the buttons that triggered them (RGB/HSL).
- The user can type an alpha value into the text input, but it is reset to 1 when the text input is blurred
Stackblitz
I prepared this Stackblitz to demo the issue https://stackblitz.com/edit/js-qur2ih
For now you can do something like this:
color.toRGBA().toString(0).replace(', 1)', ')').replace('rgba', 'rgb');
Okay, that is unexpected and not well-implemented. I'll see what I can do :)