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

Remove alpha field from color-functions if lockOpacity is set to true #257

Open
FirstVertex opened this issue Dec 4, 2020 · 2 comments
Open
Labels
improvement Something could be improved

Comments

@FirstVertex
Copy link

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:

  1. The text input still contains rgba() and hsla() functions. Expect these to only contain rgb() and hsl()
  2. These rgba and hsla representations do not match the text of the buttons that triggered them (RGB/HSL).
  3. 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

@FirstVertex FirstVertex added the bug Something isn't working label Dec 4, 2020
@simonwep simonwep added feature request New feature requested and removed bug Something isn't working labels Dec 10, 2020
@simonwep simonwep changed the title Cannot turn off alpha in text input Remove alpha field from color-functions if lockOpacity is set to true Dec 10, 2020
@Teraskull
Copy link

For now you can do something like this:

color.toRGBA().toString(0).replace(', 1)', ')').replace('rgba', 'rgb');

@simonwep simonwep added the bug Something isn't working label Mar 13, 2021
@simonwep
Copy link
Owner

Okay, that is unexpected and not well-implemented. I'll see what I can do :)

@simonwep simonwep added improvement Something could be improved and removed feature request New feature requested bug Something isn't working labels Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something could be improved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants