Skip to content

Commit 0a54df9

Browse files
committed
Merged conflicts from ColorPaletteSample and ContrastHelper in AccentAnalyzerSample
1 parent 5bc1ec3 commit 0a54df9

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

components/ColorAnalyzer/samples/AccentAnalyzerSample.xaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
</helpers:ColorPaletteSampler>
2323
</Page.Resources>
2424

25+
<!--
26+
ConstrastHelper used to auto-adjust text Foreground against the dynamic background per WCAG.
27+
This is not a ContrastHelper sample, but is used here to ensure text is always readable.
28+
-->
2529
<Grid>
2630
<Grid.ColumnDefinitions>
2731
<ColumnDefinition Width="*" />
@@ -67,7 +71,7 @@
6771
<Border.Background>
6872
<SolidColorBrush Color="{x:Bind WeightedColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
6973
</Border.Background>
70-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.DominantColor, Mode=OneWay}"
74+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind WeightedColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}"
7175
Text="Dominant" />
7276
</Border>
7377

@@ -81,10 +85,10 @@
8185
</Border.Background>
8286
<TextBlock Text="Base">
8387
<TextBlock.Foreground>
84-
<!-- ConstrastHelper used to auto-adjust text Foreground against the dynamic background per WCAG -->
88+
8589
<SolidColorBrush helpers:ContrastHelper.MinRatio="5"
86-
helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.BaseColor, Mode=OneWay}"
87-
Color="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}" />
90+
helpers:ContrastHelper.Opponent="{x:Bind BasePalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}"
91+
Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
8892
</TextBlock.Foreground>
8993
</TextBlock>
9094
</Border>
@@ -97,7 +101,7 @@
97101
<Border.Background>
98102
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
99103
</Border.Background>
100-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}"
104+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}"
101105
Text="Primary" />
102106
</Border>
103107
<!-- Secondary -->
@@ -108,7 +112,7 @@
108112
<Border.Background>
109113
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" />
110114
</Border.Background>
111-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.SecondaryAccentColor, Mode=OneWay}"
115+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}"
112116
Text="Secondary" />
113117
</Border>
114118
<!-- Tertiary -->
@@ -119,7 +123,7 @@
119123
<Border.Background>
120124
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" />
121125
</Border.Background>
122-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.TertiaryAccentColor, Mode=OneWay}"
126+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}"
123127
Text="Tertiary" />
124128
</Border>
125129

0 commit comments

Comments
 (0)