Skip to content

Commit 7ed9c4b

Browse files
authored
Merge branch 'main' into ColorAnalysis/Clustering_Refinement
2 parents 6e1cf3b + 18946f6 commit 7ed9c4b

29 files changed

+861
-333
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ jobs:
287287
fetch-depth: 0
288288
fetch-tags: true
289289

290-
- name: Format Date/Time of Commit for Package Version
290+
- name: Format Date/Time for Package Version (Tag builds only)
291+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
291292
run: |
292-
echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV
293+
$dateString = "${{ github.ref }}" -replace '^refs/tags/release/weekly/', ''
294+
echo "VERSION_DATE=$dateString" >> $env:GITHUB_ENV
293295
294296
- name: Restore dotnet tools
295297
run: dotnet tool restore
@@ -330,7 +332,7 @@ jobs:
330332
# Build and pack component nupkg
331333
- name: Build and pack component packages
332334
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
333-
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
335+
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }} ${{ env.VERSION_DATE != '' && format('-DateForVersion {0}', env.VERSION_DATE) || '' }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
334336

335337
- name: Validate package names
336338
if: ${{ env.VERSION_PROPERTY != '' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
@@ -389,7 +391,7 @@ jobs:
389391
strategy:
390392
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
391393
matrix:
392-
winui: [2, 3]
394+
winui: [0, 2, 3]
393395

394396
steps:
395397
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
@@ -454,7 +456,7 @@ jobs:
454456
strategy:
455457
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
456458
matrix:
457-
winui: [2, 3]
459+
winui: [0, 2, 3]
458460

459461
steps:
460462
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}

.github/workflows/scheduled-releases.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

components/ColorAnalyzer/samples/AccentAnalyzer.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

components/ColorAnalyzer/samples/ColorAnalyzer.Samples.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@
1818
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1919
</Content>
2020
</ItemGroup>
21-
<ItemGroup>
22-
<Folder Include="ContrastHelper\" />
23-
</ItemGroup>
2421
</Project>

components/ColorAnalyzer/samples/ColorPaletteSampler/AccentAnalyzerSample.xaml

Lines changed: 0 additions & 146 deletions
This file was deleted.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
2+
<local:ColorPaletteSamplerToolkitSampleBase x:Class="ColorAnalyzerExperiment.Samples.AccentColorSample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:helpers="using:CommunityToolkit.WinUI.Helpers"
8+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
9+
xmlns:local="using:ColorAnalyzerExperiment.Samples"
10+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
11+
mc:Ignorable="d">
12+
13+
<local:ColorPaletteSamplerToolkitSampleBase.Resources>
14+
<helpers:ColorPaletteSampler x:Name="ColorPaletteSampler"
15+
Source="{x:Bind SampledImage}">
16+
<helpers:AccentColorPaletteSelector x:Name="AccentPalette"
17+
MinColorCount="3" />
18+
</helpers:ColorPaletteSampler>
19+
</local:ColorPaletteSamplerToolkitSampleBase.Resources>
20+
21+
<!--
22+
ConstrastHelper is used in this sample to auto-adjust text Foreground to ensure
23+
readability against dynamic background. This is not the ContrastHelper sample.
24+
(though it is a fantastic example use case for it!)
25+
-->
26+
<Grid Margin="20">
27+
<Grid.ColumnDefinitions>
28+
<ColumnDefinition Width="*" />
29+
<ColumnDefinition Width="*" />
30+
</Grid.ColumnDefinitions>
31+
32+
<Grid Margin="20"
33+
VerticalAlignment="Center">
34+
<Image x:Name="SampledImage"
35+
HorizontalAlignment="Center"
36+
Source="{x:Bind SelectedImage, Mode=OneWay}"
37+
Stretch="Uniform">
38+
<interactivity:Interaction.Behaviors>
39+
<interactivity:EventTriggerBehavior EventName="ImageOpened">
40+
<interactivity:CallMethodAction MethodName="UpdatePalette"
41+
TargetObject="{x:Bind ColorPaletteSampler}" />
42+
</interactivity:EventTriggerBehavior>
43+
</interactivity:Interaction.Behaviors>
44+
</Image>
45+
</Grid>
46+
47+
<Grid Grid.Column="1"
48+
MaxWidth="400"
49+
MaxHeight="250"
50+
Margin="20"
51+
HorizontalAlignment="Stretch"
52+
VerticalAlignment="Stretch">
53+
<Grid.ColumnDefinitions>
54+
<ColumnDefinition />
55+
<ColumnDefinition />
56+
</Grid.ColumnDefinitions>
57+
<Grid.RowDefinitions>
58+
<RowDefinition />
59+
<RowDefinition Height="0.6*" />
60+
<RowDefinition Height="0.4*" />
61+
</Grid.RowDefinitions>
62+
63+
<!-- Primary Accent Color -->
64+
<Border Grid.ColumnSpan="2"
65+
Margin="4"
66+
Padding="2">
67+
<Border.Background>
68+
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
69+
</Border.Background>
70+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}"
71+
Text="Primary Accent" />
72+
</Border>
73+
74+
<!-- Secondary Accent Color -->
75+
<Border Grid.Row="1"
76+
Margin="4"
77+
Padding="2">
78+
<Border.Background>
79+
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" />
80+
</Border.Background>
81+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}"
82+
Text="Secondary Accent" />
83+
</Border>
84+
85+
<!-- Tertiary Accent Color -->
86+
<Border Grid.Row="1"
87+
Grid.Column="1"
88+
Margin="4"
89+
Padding="2">
90+
<Border.Background>
91+
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" />
92+
</Border.Background>
93+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}"
94+
Text="Tertiary Accent" />
95+
</Border>
96+
97+
<!-- Accent Colors Gradient -->
98+
<Rectangle Grid.Row="3"
99+
Grid.ColumnSpan="2"
100+
Margin="4">
101+
<Rectangle.Fill>
102+
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
103+
<GradientStopCollection>
104+
<GradientStop Offset="0" Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
105+
<GradientStop Offset="0.6" Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" />
106+
<GradientStop Offset="1" Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" />
107+
</GradientStopCollection>
108+
</LinearGradientBrush>
109+
</Rectangle.Fill>
110+
</Rectangle>
111+
</Grid>
112+
</Grid>
113+
</local:ColorPaletteSamplerToolkitSampleBase>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace ColorAnalyzerExperiment.Samples;
6+
7+
/// <summary>
8+
/// An example sample page of a custom control inheriting from Panel.
9+
/// </summary>
10+
[ToolkitSample(id: nameof(AccentColorSample), "AccentAnalyzer helper", description: $"A sample for showing how the accent analyzer can be used.")]
11+
public sealed partial class AccentColorSample : ColorPaletteSamplerToolkitSampleBase
12+
{
13+
public AccentColorSample()
14+
{
15+
this.InitializeComponent();
16+
}
17+
}

0 commit comments

Comments
 (0)