-
Notifications
You must be signed in to change notification settings - Fork 697
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
Acrylic brushes change the values I provide #1639
Comments
Per email discussion it sounds like the request is to do the color adjustment only when TintLuminosityOpacity = 1.0. If TintLuminosityOpacity < 1 then don't adjust the color. Seems simple enough? Adding help wanted. :) |
Its this, if no TintLuminosity value is supplied, letconversion logic is applied, if any value at all is supplied (0 - 1.0) do not use the conversion logic.
Cheers,
S
|
@jevansaks, that's correct. Please see the Expected Behavior section of this bug - tried to supply the behavior desired. |
Hi Kiki, just pinging y'all on this!
S
|
Hi @SpencerHurd , I would like to look into this issue, however I am not quite sure how I would be able to test/verify a suitable fix. Do you have a demo or a code snippet that I could try or use? Also I assume with |
Thanks @SpencerHurd - in the future please refrain from posting internal email on issues - just for other people's privacy. :) I have not been able to loop back on this since you first requested it. So I have no updates. @chingucoding - he's actually referring to the property on Acrylic called |
@kikisaints Thanks for the clarification! |
I’m sorry I don’t know what you mean? I filed the big the way you wanted, then emailed you to follow up on it 😊.
How do we get this tackled? This is causing accessibility problems.
S
|
Hi @chingucoding! Fantastic you are interested in helping, thank you so much! Sorry for the delayed response - I was figuring out how to use Github. The issue: its kind of hard to describe whats happening. I am a designer and cannot refer to the code of it. But Ill describe it as best I can. The acrylic brush has is comprised of a few layers that stack together to create the effect, from top to bottom:
When using the brush, developers may supply a tint color, a tint opacity, and a luminosity opacity.
So there is a lot of mathematical stuff happening inside the brush that changes the values supplied to the brush. There is a reason for this - all the conversions and adjustments occur in order to make the acrylic brush look like the original acrylic brush. However the bug is this: when the luminosity opacity value is supplied, all the fancy math logic should not be used. When luminosity opacity is provided by the developer we don't want it to look like the original acrylic, we want the values provided used unaltered by the brush. So: if no luminosity opacity value is supplied, leave the current system in place. The following should happen
I hope this helps! Spencer |
@SpencerHurd Thank you for the detailed explanation! This sure helps a lot. So the expected behavior is the following: No luminosity opacity specified: Color will be taken if V (from HSV) is between 0.125 and 0.96, otherwise take the closest of those values. Luminosity opacity specified: Take opacity and color as is, no "bounds" checking. (Currently this case also does bounds checking, which is not what we want) Is this correct? If that's the case, I would like to fix this, as long as its fine with @jevansaks, @kikisaints and @ranjeshj . |
@chingucoding your summary is correct to my understanding of the problem. If you'd like to go ahead and take this bug/issue, that's more than okay with me 😄 design has been looking forward to this change for a little bit now. |
@chingucoding What you are saying is correct, if Luminosity Opacity is specified then we want to remove the bounds on the luminosity color value so it inherits the tint color value unaltered. We also want to make sure tint opacity uses the supplied tint opacity value unaltered. Very cool, thank you! |
From the source code, it seems like the tint opacity does get in fact get altered, when we use it for the tint layer: microsoft-ui-xaml/dev/Materials/Acrylic/AcrylicBrush.cpp Lines 352 to 356 in 5e0e4df
For the luminosity layer, we are using the "raw" value i.e. we take the tint color and set its alpha value to the tint opacity value, and then continue calculating the luminosity color. microsoft-ui-xaml/dev/Materials/Acrylic/AcrylicBrush.cpp Lines 411 to 412 in 5e0e4df
Is this what you would expect @SpencerHurd ? |
Lets see 'm not 100% sure. Once luminosity opacity is supplied:
So we want to remove all adjustments to values if luminosity opacity is supplied by the dev. Does that answer the question? From how I understand what I'm seeing (I'm sorry I don't know code :/), the tint opacity is being altered, and the luminosity layer is being affected by the tint layer opacity. I suspect the brightness cap is also still in play on luminosity color. |
It's important to call out, since we don't want to eliminate any pre-existing behavior that app developers may be relying on, that:
|
Yes the only case where we want to change stuff is when luminosity opacity is actively set. Yes this whole maths is a bit complicated. So summary: The Luminosity layer should behave the following:
The other layers are already correct as they are. Is this correct @SpencerHurd and @kikisaints ? |
@chingucoding that looks correct to me. That you for summarizing. |
That is correct! Love it! thanks for stating it so simply. |
When using an acrylic brush, there is math applied to the color value, tint value, and luminosity value that change these values to make the acrylic work more like rs4 acrylic - this conversion changes our desired results, and means designers literally cannot achieve their designs - the values they hand off to code do not get reproduced by the brush. not only that, because there are value caps in place, certain values are not achievable at all.
This conversion logic is not desired by designers, and is almost entirely unknown so it cannot be worked around by many. This needs to be an option to opt in or opt out option, or a new version produced that does not have this conversion built in so expected results can be achieved.
The conversion is not documented, and is currently ignored by MS! Lets fix this to make design achievable and the brush simpler!
Bug Report
Describe the bug
There is "auto-magic" logic built into the current Acrylic brush (that was put in place to replicate the RS4 acrylic visual appearance at the time), that now conflicts with the contrast ratios needed in order to pass WCAG 2.1 accessibility requirements.
This logic affects the color of the luminosity blend mode and the tint color properties and sets them automatically based on the tint color of the brush.
Steps to reproduce the bug
Steps to reproduce the behavior:
TintLuminosityOpacity
to below #202020 and observe that it will lock at that value instead, regardless of what you put it's hex color value to.Expected behavior
If
TintLuminosityOpacity
property is set, then all automatic RS4 logic will be be ignored, and the values specified by the user will be set in the brush 1:1.Screenshots
Version Info
NuGet package version:
The text was updated successfully, but these errors were encountered: