パッケージ、リポジトリ、アプリカテゴリを検索

tint のカバー
パッケージ詳細v2.0.1

tint

`String` の拡張としてのターミナル文字列スタイル用のライブラリ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
50.6万
いいね数
41
Pub ポイント
150

パッケージをインストール

flutter pub add tint

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Tint は、String クラスの拡張としてターミナル文字列スタイル機能を追加する Flutter/Dart パッケージです。開発者がコンソールや CLI アプリケーションでのテキスト出力に簡単に色、スタイル、フォーマットを適用できるようにします。簡単な構文で、ANSI エスケープコードを裏で使用してログ、デバッグメッセージ、またはインタラクティブなプロンプトを強調表示できます。このライブラリは Android、iOS、Web、macOS、Windows、Linux などすべての主要プラットフォームをサポートしており、クロスプラットフォームのコマンドラインツールに最適です。Tint はエスケープシーケンスを手動で処理する必要なく、ターミナルの視覚的美しさを簡素化します。

用途

  • カラーコンソールログ
  • CLI ユーザーインターフェースの強化
  • デバッグメッセージのハイライト
  • ターミナルベースのダッシュボード
  • クロスプラットフォーム端末出力
  • インタラクティブなコマンドラインアプリケーション

主な機能

  • スタイル設定用のString拡張
  • ANSIエスケープコードのサポート
  • Platform-agnostic
  • シンプルな API
  • 色およびスタイルのカスタマイズ
  • 組み込みプリセット

適している対象

  • CLIツールを開発する開発者
  • コンソール出力付きのFlutterアプリ
  • ログ記録およびデバッグユーティリティ
  • クロスプラットフォーム端末アプリケーション
  • 教育またはデモプロジェクト

注意事項

  • ターミナル出力に制限
  • 実行時スタイルの変更なし
  • ターミナルのサポートに依存します
  • UIレンダリング用ではありません
  • 最小限のドキュメント
  • テーマシステムなし

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Tint

Tint is a library for terminal string styling extended upon Dart's String type.


Overview

// tint.dart
import 'package:tint/tint.dart';

void main() {
  print('underlined blue text on white background'
      .underline()
      .blue()
      .onWhite());
}

The snippet will produce an underlined blue text on a white background once you run it inside a terminal.

The example at example/main.dart file contains examples for all APIs. Try running it and you'll get something this.


Installation

Install the latest version of tint as a dependency as shown in pub.dev.


API Documentation

For reference, all of the available APIs will be used as an example in the example/main.dart file.


Foreground Colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • brightBlack or gray or grey
  • brightRed
  • brightGreen
  • brightYellow
  • brightBlue
  • brightMagenta
  • brightCyan
  • brightWhite

Background Colors

  • onBlack
  • onRed
  • onGreen
  • onYellow
  • onBlue
  • onMagenta
  • onCyan
  • onWhite
  • onBrightBlack or onGray or onGrey
  • onBrightRed
  • onBrightGreen
  • onBrightYellow
  • onBrightBlue
  • onBrightMagenta
  • onBrightCyan
  • onBrightWhite

Attributes

  • bold
  • dim
  • italic
  • underline
  • blink
  • inverse
  • strikethrough

Dynamic Colors

  • rgb({int r, int g, int b})
  • onRgb({int r, int g, int b})

Utilities

  • reset (reset the color using ANSI code)
  • strip (remove all ANSI codes)

Alternatives

Tint is an alternative to,


Acknowledgement

Node's chalk is the library that inspired tint the most but the naming of the APIs such as onMagenta instead of bgMagenta and certain aspects of the library are mostly influenced by the console crate from Rust. The ansicolor and ansi_styles packages also provide the same functionality but with a different delivery for the usage. But I personally find extension methods syntactically more fun to use.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト