|
22 | 22 | </helpers:ColorPaletteSampler> |
23 | 23 | </Page.Resources> |
24 | 24 |
|
| 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 | + --> |
25 | 29 | <Grid> |
26 | 30 | <Grid.ColumnDefinitions> |
27 | 31 | <ColumnDefinition Width="*" /> |
|
67 | 71 | <Border.Background> |
68 | 72 | <SolidColorBrush Color="{x:Bind WeightedColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
69 | 73 | </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}" |
71 | 75 | Text="Dominant" /> |
72 | 76 | </Border> |
73 | 77 |
|
|
81 | 85 | </Border.Background> |
82 | 86 | <TextBlock Text="Base"> |
83 | 87 | <TextBlock.Foreground> |
84 | | - <!-- ConstrastHelper used to auto-adjust text Foreground against the dynamic background per WCAG --> |
| 88 | + |
85 | 89 | <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}" /> |
88 | 92 | </TextBlock.Foreground> |
89 | 93 | </TextBlock> |
90 | 94 | </Border> |
|
97 | 101 | <Border.Background> |
98 | 102 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
99 | 103 | </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}" |
101 | 105 | Text="Primary" /> |
102 | 106 | </Border> |
103 | 107 | <!-- Secondary --> |
|
108 | 112 | <Border.Background> |
109 | 113 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" /> |
110 | 114 | </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}" |
112 | 116 | Text="Secondary" /> |
113 | 117 | </Border> |
114 | 118 | <!-- Tertiary --> |
|
119 | 123 | <Border.Background> |
120 | 124 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" /> |
121 | 125 | </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}" |
123 | 127 | Text="Tertiary" /> |
124 | 128 | </Border> |
125 | 129 |
|
|
0 commit comments