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
https://www.nuget.org/packages/PaletteNet
Target frameworks:
- net6.0
- net6.0-android
- net6.0-windows10.0.19041.0
- netstandard2.0
- net48
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;
Download app from Microsoft Store