22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5- using System . Windows . Input ;
65using Windows . UI ;
76
87namespace CommunityToolkit . WinUI . Helpers ;
@@ -15,36 +14,6 @@ public partial class AccentAnalyzer
1514 public static readonly DependencyProperty SourceProperty =
1615 DependencyProperty . Register ( nameof ( Source ) , typeof ( UIElement ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( null , OnSourceChanged ) ) ;
1716
18- /// <summary>
19- /// Gets the <see cref="DependencyProperty"/> for the <see cref="PrimaryAccentColor"/> property.
20- /// </summary>
21- public static readonly DependencyProperty PrimaryAccentColorProperty =
22- DependencyProperty . Register ( nameof ( PrimaryAccentColor ) , typeof ( Color ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( Colors . Transparent ) ) ;
23-
24- /// <summary>
25- /// Gets the <see cref="DependencyProperty"/> for the <see cref="SecondaryAccentColor"/> property.
26- /// </summary>
27- public static readonly DependencyProperty SecondaryAccentColorProperty =
28- DependencyProperty . Register ( nameof ( SecondaryAccentColor ) , typeof ( Color ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( Colors . Transparent ) ) ;
29-
30- /// <summary>
31- /// Gets the <see cref="DependencyProperty"/> for the <see cref="TertiaryAccentColor"/> property.
32- /// </summary>
33- public static readonly DependencyProperty TertiaryAccentColorProperty =
34- DependencyProperty . Register ( nameof ( TertiaryAccentColor ) , typeof ( Color ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( Colors . Transparent ) ) ;
35-
36- /// <summary>
37- /// Gets the <see cref="DependencyProperty"/> for the <see cref="BaseColor"/> property.
38- /// </summary>
39- public static readonly DependencyProperty BaseColorProperty =
40- DependencyProperty . Register ( nameof ( BaseColor ) , typeof ( Color ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( Colors . Transparent ) ) ;
41-
42- /// <summary>
43- /// Gets the <see cref="DependencyProperty"/> for the <see cref="DominantColor"/> property.
44- /// </summary>
45- public static readonly DependencyProperty DominantColorProperty =
46- DependencyProperty . Register ( nameof ( DominantColor ) , typeof ( Color ) , typeof ( AccentAnalyzer ) , new PropertyMetadata ( Colors . Transparent ) ) ;
47-
4817 /// <summary>
4918 /// Gets the <see cref="DependencyProperty"/> for the <see cref="Colorfulness"/> property.
5019 /// </summary>
@@ -54,7 +23,7 @@ public partial class AccentAnalyzer
5423 /// <summary>
5524 /// An event fired when the accent properties are updated.
5625 /// </summary>
57- public event EventHandler ? AccentsUpdated ;
26+ public event EventHandler ? PalettesUpdated ;
5827
5928 /// <summary>
6029 /// Gets or sets the <see cref="UIElement"/> source for accent color analysis.
@@ -66,64 +35,9 @@ public UIElement? Source
6635 }
6736
6837 /// <summary>
69- /// Gets the primary accent color as extracted from the <see cref="Source"/>.
70- /// </summary>
71- /// <remarks>
72- /// The most "colorful" found in the image.
73- /// </remarks>
74- public Color PrimaryAccentColor
75- {
76- get => ( Color ) GetValue ( PrimaryAccentColorProperty ) ;
77- protected set => SetValue ( PrimaryAccentColorProperty , value ) ;
78- }
79-
80- /// <summary>
81- /// Gets the secondary accent color as extracted from the <see cref="Source"/>.
82- /// </summary>
83- /// <remarks>
84- /// The second most "colorful" color found in the image.
85- /// </remarks>
86- public Color SecondaryAccentColor
87- {
88- get => ( Color ) GetValue ( SecondaryAccentColorProperty ) ;
89- protected set => SetValue ( SecondaryAccentColorProperty , value ) ;
90- }
91-
92- /// <summary>
93- /// Gets the tertiary accent color as extracted from the <see cref="Source"/>.
94- /// </summary>
95- /// <remarks>
96- /// The third most "colorful" color found in the image.
97- /// </remarks>
98- public Color TertiaryAccentColor
99- {
100- get => ( Color ) GetValue ( TertiaryAccentColorProperty ) ;
101- protected set => SetValue ( TertiaryAccentColorProperty , value ) ;
102- }
103-
104- /// <summary>
105- /// Gets the base color as extracted from the <see cref="Source"/>.
38+ /// The list of <see cref="ColorPalette"/> to update when the <see cref="Source"/> is set or changed.
10639 /// </summary>
107- /// <remarks>
108- /// The least "colorful" color found in the image.
109- /// </remarks>
110- public Color BaseColor
111- {
112- get => ( Color ) GetValue ( BaseColorProperty ) ;
113- protected set => SetValue ( BaseColorProperty , value ) ;
114- }
115-
116- /// <summary>
117- /// Gets the dominant color as extracted from the <see cref="Source"/>.
118- /// </summary>
119- /// <remarks>
120- /// The color that takes up the most of the image.
121- /// </remarks>
122- public Color DominantColor
123- {
124- get => ( Color ) GetValue ( DominantColorProperty ) ;
125- protected set => SetValue ( DominantColorProperty , value ) ;
126- }
40+ public IList < ColorPalette > Palettes { get ; set ; }
12741
12842 /// <summary>
12943 /// Gets the "colorfulness" of the <see cref="Source"/>.
0 commit comments