|
32 | 32 | VerticalAlignment="Center"> |
33 | 33 | <Image x:Name="SampledImage" |
34 | 34 | HorizontalAlignment="Center" |
35 | | - Source="/ColorAnalyzerExperiment.Samples/Assets/StockImages/Bloom.jpg" |
| 35 | + Source="/ColorAnalyzerExperiment.Samples/Assets/StockImages/Flowers.jpg" |
36 | 36 | Stretch="Uniform"> |
37 | 37 | <interactivity:Interaction.Behaviors> |
38 | 38 | <interactivity:EventTriggerBehavior EventName="ImageOpened"> |
|
67 | 67 | <Border.Background> |
68 | 68 | <SolidColorBrush Color="{x:Bind WeightedColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
69 | 69 | </Border.Background> |
70 | | - <TextBlock Foreground="Black" |
| 70 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.DominantColor, Mode=OneWay}" |
71 | 71 | Text="Dominant" /> |
72 | 72 | </Border> |
73 | 73 |
|
|
79 | 79 | <Border.Background> |
80 | 80 | <SolidColorBrush Color="{x:Bind BasePalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
81 | 81 | </Border.Background> |
82 | | - <TextBlock Foreground="Black" |
83 | | - Text="Base" /> |
| 82 | + <TextBlock Text="Base"> |
| 83 | + <TextBlock.Foreground> |
| 84 | + <!-- ConstrastHelper used to auto-adjust text Foreground against the dynamic background per WCAG --> |
| 85 | + <SolidColorBrush helpers:ContrastHelper.MinRatio="5" |
| 86 | + helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.BaseColor, Mode=OneWay}" |
| 87 | + Color="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}" /> |
| 88 | + </TextBlock.Foreground> |
| 89 | + </TextBlock> |
84 | 90 | </Border> |
85 | 91 |
|
86 | 92 | <!-- Primary --> |
|
91 | 97 | <Border.Background> |
92 | 98 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
93 | 99 | </Border.Background> |
94 | | - <TextBlock Foreground="Black" |
| 100 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}" |
95 | 101 | Text="Primary" /> |
96 | 102 | </Border> |
97 | 103 | <!-- Secondary --> |
|
102 | 108 | <Border.Background> |
103 | 109 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" /> |
104 | 110 | </Border.Background> |
105 | | - <TextBlock Foreground="Black" |
| 111 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.SecondaryAccentColor, Mode=OneWay}" |
106 | 112 | Text="Secondary" /> |
107 | 113 | </Border> |
108 | 114 | <!-- Tertiary --> |
|
113 | 119 | <Border.Background> |
114 | 120 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" /> |
115 | 121 | </Border.Background> |
116 | | - <TextBlock Foreground="Black" |
| 122 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentAnalyzer.TertiaryAccentColor, Mode=OneWay}" |
117 | 123 | Text="Tertiary" /> |
118 | 124 | </Border> |
119 | 125 |
|
|
0 commit comments