- Notifications
You must be signed in to change notification settings - Fork2
Tiny cross-platform terminal color library
License
NotificationsYou must be signed in to change notification settings
bbkane/gocolor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
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.
- https://github.com/TwiN/go-color (API inspiration)
- https://github.com/bbkane/go-color (my - now deprecated - fork of TwiN/go-color)
- https://github.com/fatih/color (color naming)
- https://github.com/jedib0t/go-pretty (Windows code)
About
Tiny cross-platform terminal color library
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published