musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.32k stars 2.66k forks source link

[MU4 Issue] Regression: opacity control missing in color picker #13652

Open MarcSabatella opened 2 years ago

MarcSabatella commented 2 years ago

Describe the bug MuseScore 4 lacks the opacity control in the color picker - needed for creating highlighter effects

To Reproduce Steps to reproduce the behavior:

  1. Add a staff text
  2. Set the Frame to rectangle in Properties
  3. Click the color swatch to set the flll color
  4. See error: no opacity control

Expected behavior An opacity control is needed to create translucent effects, such as mimicking a yellow highlighter pen

Screenshots This is how it looked in MuseScore 3, and shows how the feature was commonly used by educators: image

Platform information

Additional context In MU3, it was very annoyingly necessary to explicitly set this to 255 if you wanted to actually see the background color at all - the default was 0. Glad to see that opening this dialog now sets the color to opaque. But, there still needs to be a way to set it to intermediate values like 127. And, a small complication - that value, once explicitly set, should remain set and not get arbitrarily changed to 255 every time you open the dialog. So, whatever magic happens to force the opacity to 255 upon setting a color, should be smart enough not to do this if there is an explicit opacity value already set.

octopols commented 1 year ago

I want to work on this, can you please assign me this issue?

octopols commented 1 year ago

I was able to add the alpha channel in the colour picker but the task also said that the solution should be smart enough to realise when alpha is 0 and set it to max (atleast that's how I interpreted the problem). I was able to compare QColors but is there a way by which I can change the alpha value of an already existing QColor?

cbjeukendrup commented 1 year ago

How about https://doc.qt.io/qt-5/qcolor.html#setAlpha?

octopols commented 1 year ago

How about https://doc.qt.io/qt-5/qcolor.html#setAlpha?

Thanks a lot, this is what I needed.

octopols commented 1 year ago

https://user-images.githubusercontent.com/90182257/216559541-6f790556-3ae1-46ac-89c7-a281e85d9625.mp4

Jojo-Schmitz commented 5 days ago

Came up again in https://musescore.org/en/node/371565