smart_color_palette 0.0.2
smart_color_palette: ^0.0.2 copied to clipboard
SmartColorPalette is a dynamic and flexible color utility designed to streamline theming across your application. It intelligently generates and manages color shades for multiple UI elements, includin [...]
smart_color_palette #
A flexible and dynamic color palette utility for Flutter applications.
smart_color_palette helps developers generate consistent, accessible color themes across UI components such as text, icons, buttons, and borders. It automatically creates smooth transitions between base and target colors by generating 10 interpolated shades, ensuring clean design and excellent contrast for both light and dark themes.
๐ Usage #
1. Import the package #
import 'package:smart_color_palette/smart_color_palette.dart';
2. Create a color palette in colors.dart #
final palette = ColorPalette( primary: ColorPair(base: Colors.blue, target: Colors.deepPurple), base: ColorPair(base: Colors.white, target: Colors.grey[200]!), text: ColorPair(base: Colors.black, target: Colors.white), icon: ColorPair(base: Colors.grey[800]!, target: Colors.white), border: ColorPair(base: Colors.grey, target: Colors.black), );
3. Use color shades in your UI #
Container( padding: EdgeInsets.all(16), color: palette.baseColorShade2, child: Text( 'Hello Palette!', style: TextStyle(color: palette.textColorShade9), ), )
๐งช Available Shades #
Each ColorPair produces 10 interpolated shades. You can access them like:
palette.primaryColorShade1; // Lightest palette.primaryColorShade10; // Darkest
Shade Accessors: #
primaryColorShade1 โ primaryColorShade10 baseColorShade1 โ baseColorShade10 textColorShade1 โ textColorShade10 iconColorShade1 โ iconColorShade10 borderColorShade1 โ borderColorShade10 buttonColorShades1 โ buttonColorShades10
๐ก Contributions #
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
โจ Features #
- ๐จ Auto-generated 10-step color gradients between any two colors
- ๐งฉ Define custom
ColorPairs for:primary,base,text,icon,border, andbutton
- ๐ Works well with light and dark mode theming
- ๐ง Easy integration into Flutter design systems
๐ฆ Installation #
Add this to your pubspec.yaml:
dependencies:
smart_color_palette: ^1.0.0