Skip to main content

prism_palette 0.1.0 copy "prism_palette: ^0.1.0" to clipboard
prism_palette: ^0.1.0 copied to clipboard

Fast, pure-Flutter color palette extraction built on material_color_utilities. The maintained replacement for the discontinued palette_generator.

Prism Palette #

pub version pub points pub likes

Fast, pure-Flutter color palette extraction — the maintained replacement for the discontinued palette_generator.

Built on material_color_utilities — the pro-grade color science library bundled with Flutter — so results match Material 3 dynamic color behavior.

Features #

  • Dominant color extraction from any ui.Image
  • The six classic swatches: vibrant, lightVibrant, darkVibrant, muted, lightMuted, darkMuted
  • Region sampling — extract colors from a sub-rectangle of the image
  • Automatic pixel subsampling for large images (bounded, fast)
  • Pure Dart — no platform channels, works on all six platforms

Usage #

final palette = await PrismPalette.fromImage(image);

// Dynamic theming
final themeColor = palette.vibrantColor ?? palette.dominantColor;

// Full control
final muted = palette.mutedColor;
final population = palette.populationOf(palette.dominantColor);

Region sampling #

final palette = await PrismPalette.fromImage(
  image,
  region: const Rect.fromLTWH(0, 0, 0.5, 1), // left half only
);

From a list of colors #

final palette = ColorPalette.fromColors([Color(0xFFFF0000), ...]);

Migrating from palette_generator #

palette_generator prism_palette
PaletteGenerator.fromImageProvider(...) PrismPalette.fromImage(image)
palette.dominantColor?.color palette.dominantColor
palette.vibrantColor?.color palette.vibrantColor
palette.colors palette.colors
Swatch.population PaletteSwatch.population

Part of the Prism family — a cohesive suite of well-tested, pure-Flutter packages.

License #

MIT

0
likes
145
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Fast, pure-Flutter color palette extraction built on material_color_utilities. The maintained replacement for the discontinued palette_generator.

Homepage

License

MIT (license)

Dependencies

flutter, material_color_utilities

More

Packages that depend on prism_palette