color_palette_generator 2.0.1 copy "color_palette_generator: ^2.0.1" to clipboard
color_palette_generator: ^2.0.1 copied to clipboard

Color palette generator, capable to generate N colors using a set of basic colors. Supports HEX and RGBA colors.

example/color_palette_generator_example.dart

import 'package:color_palette_generator/color_palette_generator.dart';

void main() {
  // The basic color palette for color generation:
  var basicPalette =
      ColorPalette.from(['#ff0000', '#00ff00', 'rgba(0,0,255, 0.50)']);

  print('basicPalette: $basicPalette');
  // OUTPUT: basicPalette: [#ff0000, #00ff00, rgba(0, 0, 255, 0.5)]

  var colorGenerator = ColorGeneratorFromBasicPalette(basicPalette);

  // Generates a palette with 6 colors using `basicPalette` as reference.
  var expandedPalette = colorGenerator.generatePaletteAsColorPalette(6);

  print('expandedPalette: $expandedPalette');
  // OUTPUT: basicPalette: [#ff6161, #ff0000, #00ff00, rgba(0, 0, 255, 0.5), #a80000, #00a800]
}
4
likes
160
pub points
57%
popularity

Publisher

unverified uploader

Color palette generator, capable to generate N colors using a set of basic colors. Supports HEX and RGBA colors.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

swiss_knife

More

Packages that depend on color_palette_generator