Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Tiny cross-platform terminal color library

License

NotificationsYou must be signed in to change notification settings

bbkane/gocolor

Repository files navigation

TestWithReflection.png

A tiny cross-platform terminal color library that supports enabling and disabling colors.

Uses colors fromhttps://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN#text-formatting

Tested on macOS and (occasionally) on Ubuntu 20 and Windows 10.

Usage

color,err:=gocolor.Prepare(true)iferr!=nil {panic(err)}fmt.Println(color.Add(color.FgRed,"FgRed"),color.Add(color.FgCyanBright+color.Negative,"FgCyanBright+Negative"),)

Seetests for inspiration.

I usemattn/go-isatty to test my programs before enabling this.

Inspirations


[8]ページ先頭

©2009-2025 Movatter.jp