FluentColors.Maui 1.0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluentColors.Maui --version 1.0.0.5
                    
NuGet\Install-Package FluentColors.Maui -Version 1.0.0.5
                    
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="FluentColors.Maui" Version="1.0.0.5">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluentColors.Maui" Version="1.0.0.5" />
                    
Directory.Packages.props
<PackageReference Include="FluentColors.Maui">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 FluentColors.Maui --version 1.0.0.5
                    
#r "nuget: FluentColors.Maui, 1.0.0.5"
                    
#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 FluentColors.Maui@1.0.0.5
                    
#: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=FluentColors.Maui&version=1.0.0.5
                    
Install as a Cake Addin
#tool nuget:?package=FluentColors.Maui&version=1.0.0.5
                    
Install as a Cake Tool

FluentColors.Maui

NuGet License: MIT

Fluent, strongly-typed color resources for .NET MAUI! 🎨

Access colors declared inside MAUI Colors.xaml from code behind, with IntelliSense support, compile-time safety, and additional extension methods as a bonus.

How It Works

  1. Add the NuGet package to your MAUI project
  2. Build your project - the generator runs automatically
  3. Use your colors with IntelliSense support from code-behind!

The generator finds Resources/Colors.xaml, parses all color definitions, and creates Resources/AppColors.cs with strongly-typed properties + fluent extensions!

Before

label.TextColor = App.Current.Resources["ColorAccent"] as Color; // No IntelliSense, runtime errors

After


label.TextColor = AppColors.ColorAccent; 

// Bonus: some extensions!
var colorAccentLigther = AppColors.Primary.Lighten(0.3f);

Customization project tags provided to change auto-generated class name etc.

Installation

Install via NuGet Package Manager:

dotnet add package FluentColors.Maui

Or add to your .csproj:

<PackageReference Include="FluentColors.Maui" Version="2.0.0" />

Available Settings

Setting Default Description
ColorResourcesGeneratorEnabled true Enable/disable the generator
ColorResourcesClassName AppColors Name of the generated class
ColorResourcesNamespace $(RootNamespace) Namespace for the generated class

Smart Incremental Build

The generator is smart about regeneration:

  • ✅ Only runs if Colors.xaml changed - Won't trigger hot reload unnecessarily
  • ✅ Compares content, not timestamps - Ignores timestamp-only changes
  • ✅ Fast builds - Skips generation when nothing changed

You'll see:

  • ✓ Successfully generated AppColors.cs - File was regenerated
  • ⚡ AppColors.cs is up-to-date, skipping generation - Nothing changed

Requirements

  • .NET MAUI 7.0+
  • Resources/Colors.xaml file in standard MAUI format

Color Categories

Colors are automatically grouped into regions:

  • Standard Colors: Basic MAUI colors (Primary, Secondary, Tertiary, Black, White)
  • Gray Scale Colors: Colors starting with "Gray" (Gray100, Gray200, etc.)
  • Accent Colors: Colors containing "Accent" (Blue100Accent, Yellow200Accent, etc.)
  • Custom Colors: All other colors (ColorAccent, ColorSuccess, etc.)

Troubleshooting

Colors.xaml not found

Issue: Build warning "Colors.xaml not found at: ..." Solution: Ensure Resources/Colors.xaml exists in your project

Generated class not found

Issue: "The type or namespace name 'AppColors' could not be found" Solution:

  1. Build the project (generator runs on build)
  2. Check that Resources/AppColors.cs was created
  3. Verify the namespace matches your RootNamespace

IntelliSense not showing colors

Issue: Can't see color properties in autocomplete Solution:

  1. Rebuild the project
  2. Restart Visual Studio / IDE
  3. Check the generated file exists

Build errors after removing colors

Issue: Compilation errors for removed colors Solution: This is expected! The generator provides compile-time safety. Update your code to remove references to deleted colors.

Contributing

Issues and pull requests welcome! Visit our GitHub repository.

License

MIT License - see LICENSE file for details.

Credits

Created by Nick Kovalsky aka AppoMobi for the MAUI community.


Enjoy strongly-typed, fluent color resources! 🎨

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on FluentColors.Maui:

Repository Stars
DrawnUi/DrawnUi.Net
Rendering engine for .NET MAUI, Blazor, OpenTK and pure .NET powered by SkiaSharp 🎨
Version Downloads Last Updated
1.0.0.6 2,470 11/26/2025
1.0.0.5 456 10/19/2025