p-hatan/ mirror

pub repository

mirror.p-hatan.ir

ansicolor

1.1.1

Looking to add some color to your terminal logs? `ansicolor` is an xterm-256 color support library that lets you change the foreground and background color of your text.

Download archive

Readme

ANSI / Xterm 256 color library for Dart

Feel like you're missing some color in your terminal programs? Use AnsiPen to add ANSI color codes to your log messages.

Easy to disable for production, just set color_disabled = true and all codes will be empty - no re-writing debug messages.

Note: color_disabled is a global variable for all pen colors.

Example

Note: Be mindful of contrasting colors. If you set "bright white" foreground and don't adjust the background, you'll have a bad time with lighter terminals.

Foreground to bright white with default background:

AnsiPen pen = new AnsiPen()..white(bold: true);
print(pen("Bright white foreground") + " this text is default fg/bg");

Background as a peach, foreground as white:

AnsiPen pen = new AnsiPen()..white()..rgb(r: 1.0, g: 0.8, b: 0.2);
print(pen("White foreground with a peach background"));

Rainbow Demo

If you want a specific color, you can call the xterm() with the index listed in the rainbow below. To show the rainbow on your own terminal, pub run examples/ansicolor.dart

alt tag

Changelog

1.1.1

  • Pre-upgrade for nullsafety
  • clamp has a num signature, also doesn't follow inclusive-exclusive ranges, [), and is instead inclusive-inclusive, ().

1.1.0

  • Round up release closing out some older issues.
    • Try to detect is ANSI is supported
    • Update naming style; deprecate the old names.
    • write() and call() take object now.

1.0.5

  • Add types to API calls

1.0.4

  • Update styling, remove new, use final or var.
  • Support null safety

1.0.3

  • Minor updates to optional name style (s/:/=)
  • Make the description better

1.0.2

  • Adding this CHANGELOG.md
  • Moving bin/demo.dart to examples/ansicolor.dart

1.0.1

  • Updated authors

1.0.0

  • Dart 2.0 support!

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add ansicolor
pubspec.yaml
name: ansicolor
version: 1.1.1
description: >-
  Looking to add some color to your terminal logs? `ansicolor` is an xterm-256
  color support library that lets you change the foreground and background
  color of your text.
homepage: https://github.com/google/ansicolor-dart
environment:
  sdk: ">=2.0.0 <3.0.0"
dev_dependencies:
  test: ">=0.12.18"

Version history

VersionPublishedArchiveSHA-256
0.0.12013-07-15T20:24:30.258370ZDownload9de6acb674cdedf6342f618b4945cbd6570084251f292b65d757dadd58ef91c5
0.0.22013-07-15T23:22:13.407460ZDownloadac6d1145b52cb094ead7703cd3dd57127afb5bce28916f6deec39dd0b5e15f35
0.0.32013-07-15T23:24:13.720430ZDownload304d065b733e1ba5aa0100228de94303d8dfc1d61312269d4b69f0d006ad9fe6
0.0.42013-07-15T23:25:41.778340ZDownloadea71bef822510aa4fca40e694c2abd196f4d8b561bd3de6509a8c69970d927fe
0.0.52013-07-16T06:32:52.818990ZDownloadc05b0438a3a5c782ee99b117f4c35837bc710d7a9a0d441e827c28112892547b
0.0.62013-07-16T15:49:31.692860ZDownload11f137d81df8a8c8fb12a160d92762569ec0ffb061ff5ccd5e490f2be06ac3e0
0.0.72013-07-16T16:34:42.604760ZDownload61e4a86925e29416ba59049e5a399f5cac828e3132791974f930e39558ace26a
0.0.82013-07-16T16:37:34.526840ZDownloaddc6bebcb702f7d17c6b75ff910e49fd20a9ab3d349624011b7b9228e3bee4d85
0.0.92013-08-20T17:20:57.470460ZDownload8bd07953c8df95057d37ba4c69ec4a18b6642d4d5f47fc737e0176f32abaee3e
0.0.102018-06-20T15:39:14.463181ZDownload8fd46481ed12ab96becfee85e8f911574dee3686a41a2cd760790d8cba0aecda
0.1.02018-02-22T21:20:31.420904ZDownloadd6028fbfd1836856790d618088834c3e380280d0c8d5ddbba3eee8ea17a08046
0.1.12018-06-20T15:45:14.093734ZDownload51367ac75aeae7f400735d5eabe2fde6fc68a5a3b92bf4e4a4d9dd969acfb95e
1.0.12018-07-23T18:17:35.343340ZDownload09ffb1c20e8b95650cdfffcab06064056491b215e671ab9414ad6afb391391e6
1.0.22018-07-24T00:44:35.557588ZDownload9334a679c85d6637e011c4fa848c245a06c5d6ea81d85e256a00b9cb7f908fbf
1.0.42020-09-11T17:08:48.651636ZDownload788e7a4c166464aadc192fd4953c0616284bcf523c675be53162a8cd783f9253
1.0.52020-09-14T16:07:03.793438ZDownload9c62d83d3db94aeb29e8863768c441065304d4515874e4ad2a1e6d9f177d5427
1.1.02020-11-18T22:43:48.923062ZDownload801f80ebf443f0e05adcc3775e0449439d65a381beba01432a9488bfad5e0dab
1.1.12020-11-21T19:25:25.515183ZDownload78bc93b397e4c1eb2d8b47b4bee7c68831b68326dae2c43573ac10e4e192052a
2.0.0-nullsafety.02020-11-21T19:34:59.797173ZDownload4611ccc55dae803fd51c145a8b470289d9188f94edc0907c8a89ecf589a868f1
2.0.12021-03-17T16:41:26.521487ZDownload607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a
2.0.22023-10-16T18:05:00.719839ZDownload8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880
2.0.32024-08-12T15:02:37.568435ZDownload50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f

Dependencies

No direct dependencies declared.