-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
732 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...alColorUtilities.Console/ConsoleHelper.cs → ...tilities.Samples.Console/ConsoleHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?xml version = "1.0" encoding = "UTF-8" ?> | ||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:MaterialColorUtilities.Samples.Maui" | ||
x:Class="MaterialColorUtilities.Samples.Maui.App"> | ||
<Application.Resources> | ||
<!--Placeholders for IntelliSense--> | ||
<Color x:Key="Primary" /> | ||
<Color x:Key="PrimaryContainer" /> | ||
<Color x:Key="Secondary" /> | ||
<Color x:Key="SecondaryContainer" /> | ||
<Color x:Key="Tertiary" /> | ||
<Color x:Key="TertiaryContainer" /> | ||
<Color x:Key="Surface" /> | ||
<Color x:Key="SurfaceVariant" /> | ||
<Color x:Key="Background" /> | ||
<Color x:Key="Error" /> | ||
<Color x:Key="ErrorContainer" /> | ||
<Color x:Key="OnPrimary" /> | ||
<Color x:Key="OnPrimaryContainer" /> | ||
<Color x:Key="OnSecondary" /> | ||
<Color x:Key="OnSecondaryContainer" /> | ||
<Color x:Key="OnTertiary" /> | ||
<Color x:Key="OnTertiaryContainer" /> | ||
<Color x:Key="OnSurface" /> | ||
<Color x:Key="OnSurfaceVariant" /> | ||
<Color x:Key="OnError" /> | ||
<Color x:Key="OnErrorContainer" /> | ||
<Color x:Key="OnBackground" /> | ||
<Color x:Key="Outline" /> | ||
<Color x:Key="Shadow" /> | ||
<Color x:Key="InverseSurface" /> | ||
<Color x:Key="InverseOnSurface" /> | ||
<Color x:Key="InversePrimary" /> | ||
<Color x:Key="Elevation1" /> | ||
<Color x:Key="Elevation2" /> | ||
<Color x:Key="Elevation3" /> | ||
<Color x:Key="Elevation4" /> | ||
<Color x:Key="Elevation5" /> | ||
<SolidColorBrush x:Key="PrimaryBrush" /> | ||
<SolidColorBrush x:Key="PrimaryContainerBrush" /> | ||
<SolidColorBrush x:Key="SecondaryBrush" /> | ||
<SolidColorBrush x:Key="SecondaryContainerBrush" /> | ||
<SolidColorBrush x:Key="TertiaryBrush" /> | ||
<SolidColorBrush x:Key="TertiaryContainerBrush" /> | ||
<SolidColorBrush x:Key="SurfaceBrush" /> | ||
<SolidColorBrush x:Key="SurfaceVariantBrush" /> | ||
<SolidColorBrush x:Key="BackgroundBrush" /> | ||
<SolidColorBrush x:Key="ErrorBrush" /> | ||
<SolidColorBrush x:Key="ErrorContainerBrush" /> | ||
<SolidColorBrush x:Key="OnPrimaryBrush" /> | ||
<SolidColorBrush x:Key="OnPrimaryContainerBrush" /> | ||
<SolidColorBrush x:Key="OnSecondaryBrush" /> | ||
<SolidColorBrush x:Key="OnSecondaryContainerBrush" /> | ||
<SolidColorBrush x:Key="OnTertiaryBrush" /> | ||
<SolidColorBrush x:Key="OnTertiaryContainerBrush" /> | ||
<SolidColorBrush x:Key="OnSurfaceBrush" /> | ||
<SolidColorBrush x:Key="OnSurfaceVariantBrush" /> | ||
<SolidColorBrush x:Key="OnErrorBrush" /> | ||
<SolidColorBrush x:Key="OnErrorContainerBrush" /> | ||
<SolidColorBrush x:Key="OnBackgroundBrush" /> | ||
<SolidColorBrush x:Key="OutlineBrush" /> | ||
<SolidColorBrush x:Key="ShadowBrush" /> | ||
<SolidColorBrush x:Key="InverseSurfaceBrush" /> | ||
<SolidColorBrush x:Key="InverseOnSurfaceBrush" /> | ||
<SolidColorBrush x:Key="InversePrimaryBrush" /> | ||
<SolidColorBrush x:Key="Elevation1Brush" /> | ||
<SolidColorBrush x:Key="Elevation2Brush" /> | ||
<SolidColorBrush x:Key="Elevation3Brush" /> | ||
<SolidColorBrush x:Key="Elevation4Brush" /> | ||
<SolidColorBrush x:Key="Elevation5Brush" /> | ||
|
||
<Style TargetType="Page" ApplyToDerivedTypes="True"> | ||
<Setter Property="BackgroundColor" Value="{DynamicResource Background}" /> | ||
</Style> | ||
|
||
<Style TargetType="Slider"> | ||
<Setter Property="MinimumTrackColor" Value="{DynamicResource Primary}" /> | ||
<Setter Property="MaximumTrackColor" Value="{OnPlatform Android={DynamicResource Primary}, Default={DynamicResource SurfaceVariant}}" /> | ||
<Setter Property="ThumbColor" Value="{DynamicResource Primary}" /> | ||
</Style> | ||
|
||
<Style x:Key="BaseStyle" TargetType="Element"> | ||
<Setter Property="Shell.BackgroundColor" Value="{DynamicResource Elevation2}" /> | ||
<Setter Property="Shell.ForegroundColor" Value="{DynamicResource OnSurface}" /> | ||
<Setter Property="Shell.TitleColor" Value="{DynamicResource OnSurface}" /> | ||
</Style> | ||
<Style BasedOn="{StaticResource BaseStyle}" TargetType="ShellItem" ApplyToDerivedTypes="True" /> | ||
|
||
<Style TargetType="Label"> | ||
<Setter Property="TextColor" Value="{DynamicResource OnSurface}" /> | ||
</Style> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using MaterialColorUtilities.Samples.Maui.Services; | ||
|
||
namespace MaterialColorUtilities.Samples.Maui | ||
{ | ||
public partial class App : Application | ||
{ | ||
public App(ThemeService themeService) | ||
{ | ||
InitializeComponent(); | ||
|
||
themeService.Apply(); | ||
RequestedThemeChanged += (sender, args) => themeService.Apply(); | ||
|
||
MainPage = new AppShell(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using MaterialColorUtilities.Blend; | ||
using MaterialColorUtilities.Palettes; | ||
using MaterialColorUtilities.Schemes; | ||
|
||
namespace MaterialColorUtilities.Samples.Maui; | ||
|
||
public partial class AppScheme<TColor> : Scheme<TColor> | ||
{ | ||
public TColor Elevation1 { get; set; } | ||
public TColor Elevation2 { get; set; } | ||
public TColor Elevation3 { get; set; } | ||
public TColor Elevation4 { get; set; } | ||
public TColor Elevation5 { get; set; } | ||
} | ||
|
||
public class DarkAppSchemeMapper : DarkSchemeMapper<CorePalette, AppScheme<int>> | ||
{ | ||
protected override void MapCore(CorePalette corePalette, AppScheme<int> scheme) | ||
{ | ||
base.MapCore(corePalette, scheme); | ||
scheme.Elevation1 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .05); | ||
scheme.Elevation2 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .08); | ||
scheme.Elevation3 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .11); | ||
scheme.Elevation4 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .12); | ||
scheme.Elevation5 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .14); | ||
} | ||
} | ||
|
||
public class LightAppSchemeMapper : LightSchemeMapper<CorePalette, AppScheme<int>> | ||
{ | ||
protected override void MapCore(CorePalette corePalette, AppScheme<int> scheme) | ||
{ | ||
base.MapCore(corePalette, scheme); | ||
scheme.Elevation1 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .05); | ||
scheme.Elevation2 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .08); | ||
scheme.Elevation3 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .11); | ||
scheme.Elevation4 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .12); | ||
scheme.Elevation5 = Blender.Cam16Ucs(scheme.Background, scheme.Primary, .14); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Shell | ||
x:Class="MaterialColorUtilities.Samples.Maui.AppShell" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:MaterialColorUtilities.Samples.Maui" | ||
Shell.FlyoutBehavior="Flyout" | ||
> | ||
|
||
<ShellContent | ||
Title="Theme settings" | ||
ContentTemplate="{DataTemplate local:ThemePage}" | ||
Route="ThemePage" | ||
/> | ||
|
||
<ShellContent | ||
Title="Graphs" | ||
ContentTemplate="{DataTemplate local:GraphsPage}" | ||
Route="GraphsPage" /> | ||
|
||
</Shell> |
10 changes: 10 additions & 0 deletions
10
Samples/MaterialColorUtilities.Samples.Maui/AppShell.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace MaterialColorUtilities.Samples.Maui | ||
{ | ||
public partial class AppShell : Shell | ||
{ | ||
public AppShell() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.