패키지, 저장소 및 앱 카테고리 검색

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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트