PaletteNet 3.0.1

dotnet add package PaletteNet --version 3.0.1
NuGet\Install-Package PaletteNet -Version 3.0.1
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="PaletteNet" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PaletteNet --version 3.0.1
#r "nuget: PaletteNet, 3.0.1"
#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.
// Install PaletteNet as a Cake Addin
#addin nuget:?package=PaletteNet&version=3.0.1

// Install PaletteNet as a Cake Tool
#tool nuget:?package=PaletteNet&version=3.0.1

PaletteNet

Library to extract prominent colors from an image.

  • Dominant
  • Vibrant
  • Vibrant Dark
  • Vibrant Light
  • Muted
  • Muted Dark
  • Muted Light

.NET port of Android's Palette https://developer.android.com/reference/android/support/v7/graphics/Palette.html

Install

Nuget https://www.nuget.org/packages/PaletteNet

Target frameworks:

  • net6.0
  • net6.0-android
  • net6.0-windows10.0.19041.0
  • netstandard2.0
  • net48

Example (WinUI3)

using IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);

PaletteColors palette = PaletteColors.Generate(new BitmapDecoderHelper(decoder));
Color dominantColor = palette.DominantColor;
IEnumerable<Color> allColors = palette.GetAllColors();

or

IBitmapHelper bitmapHelper = new BitmapDecoderHelper(decoder);
PaletteBuilder paletteBuilder = new PaletteBuilder();
Palette palette = paletteBuilder.Generate(bitmapHelper);
int? rgbColor = palette.MutedColor;
int? rgbTextColor = palette.DominantSwatch.TitleTextColor;

screenshot 1 screenshot 2

Sample app

Download app from Microsoft Store

<a href='https://www.microsoft.com/en-us/p/palettenet-sample-app/9MTQD4S7C86H?cid=badgegithub'> <img width='240' height='96' src='https://get.microsoft.com/images/en-us%20dark.svg' alt='English badge'/></a>

Color palette icons created by Freepik - Flaticon

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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.  net6.0-windows10.0.19041 is compatible.  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 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  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. 
.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 is compatible.  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.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net6.0-windows10.0.19041

    • No dependencies.
  • net8.0

    • No dependencies.
  • net8.0-android34.0

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PaletteNet:

Package Downloads
PaletteNet.WriteableBitmapEx

.NET port of Android's Palette

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.1 146 1/5/2024
3.0.0 367 11/11/2022
2.0.0 308 11/9/2022
1.0.1 581 9/23/2019
1.0.0 441 9/21/2019

Target .Net 6