Tuesday, 22 September 2015

Dart POW - ( Package Of The Week) #11 : colorful

Who is ready for another - Dart POW? A weekly look at an interesting Package on pub.dartlang.org

colorful is a package that helps creates 'a List of equally distant random colors'. Handy if you need a palette and you know I like some colour on this blog!


  var output = querySelector('#output');
  WarmPalette wp = new WarmPalette(10);
  List cl = wp.colors();

  cl.forEach((HexColor color) {
    var line = new HeadingElement.h1();
    line
      ..text = 'Dart is Awesome!'
      ..style.color = '#ffffff'
      ..style.backgroundColor = color.toCssString()
      ..style.margin = '15px'
      ..style.padding = '2px';
    output.append(line);
  });

Feel free to leave a comment with suggestions for the next Dart POW post! Don't be too shy to suggest your own package :-)