Buscar pacotes, repositórios e categorias de apps

Repositório GitHubgoogle/ansicolor-dart

ansicolor-dart

google/ansicolor-dart open-source repository details.

Capa do projeto ansicolor-dart
Estrelas
105
Forks
25
Último push (UTC)
11 de ago. de 2024
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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 = AnsiPen()..white(bold: true);
print(pen("Bright white foreground") + " this text is default fg/bg");

Background as a peach, foreground as white:

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

Note

If color isn't working for you; try setting ansiColorDisabled = false;. We're relying on the stdio object to inform us of ANSI terminal support. Sometimes this is wrong.

Prior versions of this library just turned on color by default.

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

Google GitHub avatar
Autor no GitHub

Google ↗

Google ❤️ Open Source

United States of AmericaSite oficial ↗
LinguagensDart

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 2 itens

  • lintsDesenvolvimento^4.0.0
  • testDesenvolvimento^1.16.8

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗