Nyan.MaterialDesign.Color.Schemes.Custom 1.0.2

dotnet add package Nyan.MaterialDesign.Color.Schemes.Custom --version 1.0.2
                    
NuGet\Install-Package Nyan.MaterialDesign.Color.Schemes.Custom -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nyan.MaterialDesign.Color.Schemes.Custom" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nyan.MaterialDesign.Color.Schemes.Custom" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Nyan.MaterialDesign.Color.Schemes.Custom" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nyan.MaterialDesign.Color.Schemes.Custom --version 1.0.2
                    
#r "nuget: Nyan.MaterialDesign.Color.Schemes.Custom, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nyan.MaterialDesign.Color.Schemes.Custom@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nyan.MaterialDesign.Color.Schemes.Custom&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Nyan.MaterialDesign.Color.Schemes.Custom&version=1.0.2
                    
Install as a Cake Tool

MaterialDesign.Color.Schemes.Custom adds support for creating custom color schemes and themes with customized rules. These custom schemes aren't just custom colors, but custom rules, like the gap between core and on-core colors, the gap between light and dark mode schemes, custom handling of secondary, tertiary, and surface color generation, and more.

To create these custom schemes, create a new record inheriting from CustomSchemeBase, and then define all the abstract properties, alongside overriding the virtual ones — should you wish to use them. Then, to construct the scheme, create a constructor using the base(HCTA) constructor, and that should let you access all the colors from the record successfully. Using primary constructor syntax, the start of your class could look like:

using MaterialDesign.Color.Schemes.Custom;

public sealed record CustomScheme(HCTA Source) : CustomSchemeBase(Source)
{
    // implementations
}

Additionally, you can use extensions to IServiceCollection and then use the ThemeCollection class in DI that supports IScheme classes (which CustomSourceBase inherits from), so you can use that instead of a regular Theme (which is still a great choice for ease-of-use, or if you don't need the extra customization).

For schemes that can be changed at runtime, the ModifiableCustomScheme is an option in that case. Additionally, on the ModifiableCustomScheme, changing the Hue, Chroma, and Tone properties on the instance instead of modifying the Origin is recommended. Otherwise, using the Update() method instead would be the next option.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 283 4/7/2024
1.0.1 205 3/22/2024
1.0.0 252 3/3/2024 1.0.0 is deprecated because it has critical bugs.