dynamic_color 1.1.1 copy "dynamic_color: ^1.1.1" to clipboard
dynamic_color: ^1.1.1 copied to clipboard

outdated

Flutter package to obtain dynamic colors on Android S+ and create harmonized color schemes.

dynamic_color #

ci pub package

A Flutter package to obtain dynamic colors on Android S+ and create harmonized color schemes.

Learn more about dynamic color. and harmonization on the Material 3 site.

Features #

Builder widget #

For convenience, this package includes DynamicColorBuilder, a stateful widget that provides the device's dynamic colors in a light and dark ColorScheme.

Plugin #

Under the hood, DynamicColorBuilder uses a plugin to talk to the Android OS.

Color and color scheme harmonization #

How do we ensure any particular color (i.e. semantic/custom color) looks good next to a user's dynamically-generated color?

This package provides two extension methods, Color.harmonizeWith() and ColorScheme.harmonized() to accomplish this.

Color.harmonizeWith() shift the hue of the color towards the passed in color, typically colorScheme.primary. This leaves the color recognizable while harmonizing it.

ColorScheme.harmonized() does the same thing, for all ColorScheme's semantic and custom colors. See harmonization.dart for more.

Getting started #

flutter pub add dynamic_color

import 'package:dynamic_color/dynamic_color.dart';

Usage #

See this complete example for obtaining dynamic colors and creating a harmonized color scheme.

All examples are hosted on GitHub and can be run with:

cd example
flutter run
548
likes
0
pub points
98%
popularity

Publisher

verified publishermaterial.io

Flutter package to obtain dynamic colors on Android S+ and create harmonized color schemes.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_test, material_color_utilities

More

Packages that depend on dynamic_color