yaansi 0.9.0 copy "yaansi: ^0.9.0" to clipboard
yaansi: ^0.9.0 copied to clipboard

Yet another ANSI implementation to color your terminal!

yaansi #

Yet another ANSI implementation to color your terminal!

Notable source: https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797

Usage #

Install:

dart pub add yaansi

Use:

import 'package:yaansi/yaansi.dart';

void main() {
  // extensions
  print('Lorem ipsum'.bold.red);

  // functions
  print(blue(italic('Lorem ipsum')));

  // inline mixing and nesting
  print('${green(' Lorem').bold} ${redBg(' ipsum ').white}'.whiteBg);

  // reusable styling
  const style = YaansiStyle(
    color: YaansiColor.yellow,
    bgColor: YaansiColor.black,
    modes: {YaansiMode.bold, YaansiMode.italic},
  );
  print(style.apply('One'));
  print(style.apply('Two'));
}

Notes #

  • Supports only basic colors and modes.

License #

See the LICENSE file.

Version history #

See the CHANGELOG.md file.

3
likes
0
pub points
42%
popularity

Publisher

verified publisher0ohm.de

Yet another ANSI implementation to color your terminal!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on yaansi