enhanced_gradients 1.0.1 copy "enhanced_gradients: ^1.0.1" to clipboard
enhanced_gradients: ^1.0.1 copied to clipboard

Flutter gradient wrappers that interpolate colors in the HCT color system.

enhanced_gradients #

enhanced_gradients pub-web.flutter-io.cn badge

This package adds an easy way to enhance your Flutter gradients and color transitions by interpolating colors in the HCT color system provided by the material_color_utilities package.

Usage #

The package exposes two ways to modify the built-in LinearGradient, RadialGradient and SweepGradient gradients:

// 1st way: extension method

LinearGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
).enhanced()

RadialGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
).enhanced()

SweepGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
).enhanced()
// 2nd way: `Enhanced*Gradient` class

EnhancedLinearGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
)

EnhancedRadialGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
)

EnhancedSweepGradient(
  colors: const [Color(0xFF000000), Color(0xFFFFFFFF)],
  // ...
)

There is also a HctColorTween that can be used instead of the regular ColorTween to interpolate colors in the HCT color system in Flutter animations.

11
likes
90
pub points
73%
popularity

Publisher

verified publisherleancode.co

Flutter gradient wrappers that interpolate colors in the HCT color system.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

collection, flutter, material_color_utilities

More

Packages that depend on enhanced_gradients