Skip to content
pubscout

palette_generator_master

1.2.0, released 6 days ago by swanflutterdev.com

Extracts prominent colors, color harmonies, and checks accessibility contrast from images in Flutter.

WASM-ready
$ flutter pub add palette_generator_master
Source repository

What it does

Analyzes images from various sources (providers, bytes, or ui.Image) to extract prominent colors like vibrant, muted, and dominant tones. It also computes color harmonies and verifies WCAG contrast compliance for accessibility.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to dynamically theme your app UI based on a loaded image.
  • You want to ensure accessible text color choices against dynamic image backgrounds.
  • You need color quantization and harmony generation from artwork or user-uploaded photos.

Skip it when

  • You only need basic image loading and display without color analysis.
  • You require complex image manipulation like cropping, resizing, or filtering for display.

Strengths

  • Supports multiple color spaces (RGB, HSV, LAB).
  • Built-in accessibility checking for WCAG compliance.
  • Generates color harmonies (complementary, triadic, analogous).

Weaknesses

  • Heavy image processing operations can impact performance if run excessively on the main thread.
  • Relies on the availability of image decoding capabilities.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
final PaletteGeneratorMaster paletteGenerator = await PaletteGeneratorMaster.fromImageProvider(AssetImage('assets/my_image.jpg'), generateHarmony: true);
final Color? dominantColor = paletteGenerator.dominantColor?.color;

Alternatives

Packages that do the same job and could replace palette_generator_master.

  • image

    Choose this if you need low-level image decoding, manipulation, and pixel processing rather than high-level palette generation.