smart_color_palette 0.0.2 copy "smart_color_palette: ^0.0.2" to clipboard
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, and button
  • ๐ŸŒ“ 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
3
likes
115
points
15
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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, including primary and base colors, as well as optional text, icon, and border themes. With built-in shade generation and responsive contrast handling, it ensures consistent visual aesthetics and accessibility across light and dark modes.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on smart_color_palette