material_color_gen 2.0.0 icon indicating copy to clipboard operation
material_color_gen: ^2.0.0 copied to clipboard

A Flutter package to generate a MaterialColor from a Color

This package allows you to generate a MaterialColor from a Color using Dart Extensions, which useful when wanting to use a custom color for ThemeData.primarySwatch.

Features #

Things it can do:

  • It can generate a MaterialColor from a Color.

Things it can't do:

  • Literally everything else.

Getting started #

This is a native package so there is nothing else needed for it to work on all Flutter supported platforms.

Usage #

final MaterialColor = Color(0xFF2929FF).toMaterialColor();

It's that easy! Just don't forget to import the library:

import 'package:material_color_gen/material_color_gen.dart';

Additional information #

If you feel something extra could be contributed to this package, then please feel free to submit your feature request as an issue on GitHub, or alternatively write it yourself and submit a PR.

12
likes
110
pub points
87%
popularity

Publisher

verified publisher iconliam.kiwi

A Flutter package to generate a MaterialColor from a Color

Homepage

Documentation

API reference

License

Icon for licenses.unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on material_color_gen