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

Update elevation strokes #4250

Merged
merged 1 commit into from
Feb 19, 2021
Merged

Conversation

beervoley
Copy link
Contributor

Description

This change will update visuals for TextControlElevationBorderBrush, ControlElevationBorderBrush and AccentControlElevationBorderBrush to match the colors of the design.

Motivation and Context

At this time color interpolation starts at the wrong coordinates (in the brushes listed above) in the elevation border brushes what causes the color of the border's bottom stroke be incorrect. This PR fixes it.

I've also made some changes to TextControlElevationBorderFocusedBrush, however this change doesn't change visual (only a very little bit) but makes the start and end points of the gradient whole numbers.

How Has This Been Tested?

Manually

Screenshots (if appropriate):

Neutral Component (ComboBox):
image
TextBox:
image
Focused TextBox:
image
Accent Button:
image

@beervoley beervoley added area-UIDesign UI Design, styling team-Controls Issue for the Controls team labels Feb 18, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 18, 2021
@beervoley
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

<LinearGradientBrush.RelativeTransform>
<ScaleTransform ScaleY="-1" CenterY="0.5"/>
</LinearGradientBrush.RelativeTransform>
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="{ThemeResource SystemAccentColorDark1}"/>
<GradientStop Offset="1.0" Color="{ThemeResource SystemAccentColorDark1}"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two stops at the same coordinate seems odd, especially when there's not a stop at 0. What does this mean?

Copy link
Contributor Author

@beervoley beervoley Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jevansaks @tashatitova

StartPoint="0,0" EndPoint="0,2"
<GradientStop Offset="1.0" Color="{ThemeResource SystemAccentColorDark1}"/>
<GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}"/>

As I understand it: here we have StartPoint=0,0 and EndPoint=0,2; by setting both stops to 1 we get the bottom stroke of the border to be one solid color (in this case SystemAccentColorDark1) and not interpolate between SystemAccentColorDark1 and ControlStrokeColorDefault at all until we reach end point 0,2. After we reach that point (0,2) we'll switch the color to SystemAccentColorDark1. By doing this, we'll make sure that bottom stroke is one solid color and is not interpolated along the way until we reach the stop.

image

To see the difference:

StartPoint="0,0" EndPoint="0,2"
<GradientStop Offset="0.5" Color="Red"/>
<GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}"/>

In this case we'll draw the bottom stroke (1px height: Ofsset=0.5 out of height=2 yields 1px) with Red and interpolation will start right after that on the rounded corner and eventually reach ControlStrokeColorDefault:
image

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Feb 19, 2021
@beervoley beervoley merged commit cabc667 into master Feb 19, 2021
@beervoley beervoley deleted the user/vsiliush/fix-elevation-strokes branch February 19, 2021 23:05
marcelwgn pushed a commit to marcelwgn/microsoft-ui-xaml that referenced this pull request Mar 5, 2021
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Oct 31, 2023
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-UIDesign UI Design, styling team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants