Specify color types, luminosity, and output formats
Direct integration with Flutter's Color class
Highly customizable with easy-to-use API
Consistent results across platforms
Installation
Add this to your package's pubspec.yaml file:
dependencies:flutter_randomcolor:^1.0.16
Then run:
$ flutter pub get
Quick Start
import'package:flutter_randomcolor/flutter_randomcolor.dart';
// Generate a random colorvar color = RandomColor.getColor(Options());
// Generate a Flutter Color objectColor flutterColor = RandomColor.getColorObject(Options());
Usage Guide
Basic Usage
Generate a random color with default options:
var color = RandomColor.getColor(Options());
Flutter Integration
Get a Color object for direct use in Flutter widgets:
Color widgetColor = RandomColor.getColorObject(Options(
colorType: ColorType.blue,
luminosity: Luminosity.light,
));
// Use in a widgetContainer(
color: widgetColor,
child: Text('Colored Container'),
)