A Flutter plugin that grabs the dominant color or a representative color palette from an image.
It's used in 12 Colors android app.
Note: This plugin is still under development iOS is not currently supported. Feedback welcome and Pull Requests are most welcome!
import 'package:colorthief/colorthief.dart' as ColorThiefProvider;
...
getColors() async {
File image; // From image_picker or somewhere else
List<ColorThiefProvider.Color> _palette = await ColorThiefProvider.getPalette(image: image, size: 12);
print(_palette);
}
- Sven Woltmann - For the java version, available at https://github.com/SvenWoltmann/color-thief-java/
- Lokesh Dhakar - for the original Color Thief JavaScript version, available at http://lokeshdhakar.com/projects/color-thief/