{"id":13410000,"url":"https://github.com/gookit/color","last_synced_at":"2025-05-11T05:45:04.676Z","repository":{"id":37471315,"uuid":"139308927","full_name":"gookit/color","owner":"gookit","description":"🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库，支持16色，256色，RGB色彩渲染输出，使用类似于 Print/Sprintf，兼容并支持 Windows 环境的色彩渲染","archived":false,"fork":false,"pushed_at":"2025-05-05T15:08:09.000Z","size":4274,"stargazers_count":1545,"open_issues_count":5,"forks_count":91,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-08T17:18:30.612Z","etag":null,"topics":["256-colors","cli","cli-color","color","color-rgb","colors","command-line","console","console-color","go-color","gookit","rgb-color","terminal","terminal-colors","true-color"],"latest_commit_sha":null,"homepage":"https://gookit.github.io/color/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gookit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-01T07:28:17.000Z","updated_at":"2025-04-28T04:34:12.000Z","dependencies_parsed_at":"2023-11-07T05:15:56.371Z","dependency_job_id":"daa3b6cb-4998-48aa-9623-310123121488","html_url":"https://github.com/gookit/color","commit_stats":{"total_commits":295,"total_committers":13,"mean_commits":"22.692307692307693","dds":"0.22372881355932206","last_synced_commit":"c76538d4506d1c694fb501c1de79c2c18fb5c2c9"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gookit%2Fcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gookit%2Fcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gookit%2Fcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gookit%2Fcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gookit","download_url":"https://codeload.github.com/gookit/color/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253485166,"owners_count":21915964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["256-colors","cli","cli-color","color","color-rgb","colors","command-line","console","console-color","go-color","gookit","rgb-color","terminal","terminal-colors","true-color"],"created_at":"2024-07-30T20:01:04.431Z","updated_at":"2025-05-11T05:45:04.657Z","avatar_url":"https://github.com/gookit.png","language":"Go","funding_links":[],"categories":["HarmonyOS","开源类库","Go","Command Line","Programming","CLI frameworks","Open source library","命令行","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`","Build Automation","lib","高级控制台UI"],"sub_categories":["Windows Manager","命令行","Advanced Console UIs","Golang","Command Line","高级控制台用户界面","标准 CLI"],"readme":"# CLI Color\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/gookit/color?style=flat-square)\n[![Actions Status](https://github.com/gookit/color/workflows/action-tests/badge.svg)](https://github.com/gookit/color/actions)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7fef8d74c1d64afc99ce0f2c6d3f8af1)](https://www.codacy.com/gh/gookit/color/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=gookit/color\u0026amp;utm_campaign=Badge_Grade)\n[![GoDoc](https://godoc.org/github.com/gookit/color?status.svg)](https://pkg.go.dev/github.com/gookit/color?tab=overview)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gookit/color)](https://github.com/gookit/color)\n[![Build Status](https://travis-ci.org/gookit/color.svg?branch=master)](https://travis-ci.org/gookit/color)\n[![Coverage Status](https://coveralls.io/repos/github/gookit/color/badge.svg?branch=master)](https://coveralls.io/github/gookit/color?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gookit/color)](https://goreportcard.com/report/github.com/gookit/color)\n\nA command-line color library with 16/256/True color support, universal API methods and Windows support.\n\n\u003e **[中文说明](README.zh-CN.md)**\n\nBasic color preview:\n\n![basic-color](_examples/images/basic-color2.png)\n\nNow, 256 colors and RGB colors have also been supported to work in Windows CMD and PowerShell:\n\n![color-on-cmd-pwsh](_examples/images/color-on-cmd-pwsh.jpg)\n\n## Features\n\n  - Simple to use, zero dependencies\n  - Supports rich color output: 16-color (4-bit), 256-color (8-bit), true color (24-bit, RGB)\n    - 16-color output is the most commonly used and most widely supported, working on any Windows version\n    - Since `v1.2.4` **the 256-color (8-bit), true color (24-bit) support windows CMD and PowerShell**\n    - See [this gist](https://gist.github.com/XVilka/8346728) for information on true color support\n  - Support converts `HEX` `HSL` value to RGB color\n  - Generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`\n  - Supports HTML tag-style color rendering, such as `\u003cgreen\u003emessage\u003c/\u003e \u003cfg=red;bg=blue\u003etext\u003c/\u003e`.\n    - In addition to using built-in tags, it also supports custom color attributes\n    - Custom color attributes support the use of 16 color names, 256 color values, rgb color values and hex color values\n    - Support working on Windows `cmd` and `powerShell` terminal\n  - Basic colors: `Bold`, `Black`, `White`, `Gray`, `Red`, `Green`, `Yellow`, `Blue`, `Magenta`, `Cyan`\n  - Additional styles: `Info`, `Note`, `Light`, `Error`, `Danger`, `Notice`, `Success`, `Comment`, `Primary`, `Warning`, `Question`, `Secondary`\n  - Support by set `NO_COLOR` for disable color or use `FORCE_COLOR` for force open color render.\n  - Support Rgb, 256, 16 color conversion\n\n## GoDoc\n\n  - [godoc for gopkg](https://pkg.go.dev/gopkg.in/gookit/color.v1)\n  - [godoc for github](https://pkg.go.dev/github.com/gookit/color)\n\n## Install\n\n```bash\ngo get github.com/gookit/color\n```\n\n## Quick start\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gookit/color\"\n)\n\nfunc main() {\n\t// quick use package func\n\tcolor.Redp(\"Simple to use color\")\n\tcolor.Redln(\"Simple to use color\")\n\tcolor.Greenp(\"Simple to use color\\n\")\n\tcolor.Cyanln(\"Simple to use color\")\n\tcolor.Yellowln(\"Simple to use color\")\n\n\t// quick use like fmt.Print*\n\tcolor.Red.Println(\"Simple to use color\")\n\tcolor.Green.Print(\"Simple to use color\\n\")\n\tcolor.Cyan.Printf(\"Simple to use %s\\n\", \"color\")\n\tcolor.Yellow.Printf(\"Simple to use %s\\n\", \"color\")\n\n\t// use like func\n\tred := color.FgRed.Render\n\tgreen := color.FgGreen.Render\n\tfmt.Printf(\"%s line %s library\\n\", red(\"Command\"), green(\"color\"))\n\n\t// custom color\n\tcolor.New(color.FgWhite, color.BgBlack).Println(\"custom color style\")\n\n\t// can also:\n\tcolor.Style{color.FgCyan, color.OpBold}.Println(\"custom color style\")\n\n\t// internal theme/style:\n\tcolor.Info.Tips(\"message\")\n\tcolor.Info.Prompt(\"message\")\n\tcolor.Info.Println(\"message\")\n\tcolor.Warn.Println(\"message\")\n\tcolor.Error.Println(\"message\")\n\n\t// use style tag\n\tcolor.Print(\"\u003csuc\u003ehe\u003c/\u003e\u003ccomment\u003ello\u003c/\u003e, \u003ccyan\u003ewel\u003c/\u003e\u003cred\u003ecome\u003c/\u003e\\n\")\n\t// Custom label attr: Supports the use of 16 color names, 256 color values, rgb color values and hex color values\n\tcolor.Println(\"\u003cfg=11aa23\u003ehe\u003c/\u003e\u003cbg=120,35,156\u003ello\u003c/\u003e, \u003cfg=167;bg=232\u003ewel\u003c/\u003e\u003cfg=red\u003ecome\u003c/\u003e\")\n\n\t// apply a style tag\n\tcolor.Tag(\"info\").Println(\"info style text\")\n\n\t// prompt message\n\tcolor.Info.Prompt(\"prompt style message\")\n\tcolor.Warn.Prompt(\"prompt style message\")\n\n\t// tips message\n\tcolor.Info.Tips(\"tips style message\")\n\tcolor.Warn.Tips(\"tips style message\")\n}\n```\n\nRun demo: `go run ./_examples/demo.go`\n\n![colored-out](_examples/images/color-demo.jpg)\n\n## Basic/16 color\n\nSupported on any Windows version. Provide generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`\n\n```go\ncolor.Bold.Println(\"bold message\")\ncolor.Cyan.Println(\"yellow message\")\ncolor.Yellow.Println(\"yellow message\")\ncolor.Magenta.Println(\"yellow message\")\n\n// Only use foreground color\ncolor.FgCyan.Printf(\"Simple to use %s\\n\", \"color\")\n// Only use background color\ncolor.BgRed.Printf(\"Simple to use %s\\n\", \"color\")\n```\n\nRun demo: `go run ./_examples/color_16.go`\n\n![basic-color](_examples/images/basic-color.png)\n\n### Custom build color\n\n```go\n// Full custom: foreground, background, option\nmyStyle := color.New(color.FgWhite, color.BgBlack, color.OpBold)\nmyStyle.Println(\"custom color style\")\n\n// can also:\ncolor.Style{color.FgCyan, color.OpBold}.Println(\"custom color style\")\n```\n\ncustom set console settings:\n\n```go\n// set console color\ncolor.Set(color.FgCyan)\n\n// print message\nfmt.Print(\"message\")\n\n// reset console settings\ncolor.Reset()\n```\n\n### Additional styles\n\nprovide generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`\n\nprint message use defined style:\n\n```go\ncolor.Info.Println(\"Info message\")\ncolor.Notice.Println(\"Notice message\")\ncolor.Error.Println(\"Error message\")\n// ...\n```\n\nRun demo: `go run ./_examples/theme_basic.go`\n\n![theme-basic](_examples/images/theme-basic.png)\n\n**Tips style**\n\n```go\ncolor.Info.Tips(\"Info tips message\")\ncolor.Notice.Tips(\"Notice tips message\")\ncolor.Error.Tips(\"Error tips message\")\ncolor.Secondary.Tips(\"Secondary tips message\")\n```\n\nRun demo: `go run ./_examples/theme_tips.go`\n\n![theme-tips](_examples/images/theme-tips.png)\n\n**Prompt Style**\n\n```go\ncolor.Info.Prompt(\"Info prompt message\")\ncolor.Notice.Prompt(\"Notice prompt message\")\ncolor.Error.Prompt(\"Error prompt message\")\n// ...\n```\n\nRun demo: `go run ./_examples/theme_prompt.go`\n\n![theme-prompt](_examples/images/theme-prompt.png)\n\n**Block Style**\n\n```go\ncolor.Danger.Block(\"Danger block message\")\ncolor.Warn.Block(\"Warn block message\")\n// ...\n```\n\nRun demo: `go run ./_examples/theme_block.go`\n\n![theme-block](_examples/images/theme-block.png)\n\n## 256-color usage\n\n\u003e 256 colors support Windows CMD, PowerShell environment after `v1.2.4`\n\n### Set the foreground or background color\n\n- `color.C256(val uint8, isBg ...bool) Color256`\n\n```go\nc := color.C256(132) // fg color\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n\nc := color.C256(132, true) // bg color\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n```\n\n### 256-color style\n\nCan be used to set foreground and background colors at the same time.\n\n- `S256(fgAndBg ...uint8) *Style256`\n\n```go\ns := color.S256(32, 203)\ns.Println(\"message\")\ns.Printf(\"format %s\", \"message\")\n```\n\nwith options:\n\n```go\ns := color.S256(32, 203)\ns.SetOpts(color.Opts{color.OpBold})\n\ns.Println(\"style with options\")\ns.Printf(\"style with %s\\n\", \"options\")\n```\n\nRun demo: `go run ./_examples/color_256.go`\n\n![color-tags](_examples/images/color-256.png)\n\n## RGB/True color\n\n\u003e RGB colors support Windows `CMD`, `PowerShell` environment after `v1.2.4`\n\n**Preview:**\n\n\u003e Run demo: `Run demo: go run ./_examples/color_rgb.go`\n\n![color-rgb](_examples/images/color-rgb.png)\n\nexample:\n\n```go\ncolor.RGB(30, 144, 255).Println(\"message. use RGB number\")\n\ncolor.HEX(\"#1976D2\").Println(\"blue-darken\")\ncolor.HEX(\"#D50000\", true).Println(\"red-accent. use HEX style\")\n\ncolor.RGBStyleFromString(\"213,0,0\").Println(\"red-accent. use RGB number\")\ncolor.HEXStyle(\"eee\", \"D50000\").Println(\"deep-purple color\")\n```\n\n### Set the foreground or background color\n\n- `color.RGB(r, g, b uint8, isBg ...bool) RGBColor`\n\n```go\nc := color.RGB(30,144,255) // fg color\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n\nc := color.RGB(30,144,255, true) // bg color\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n```\n\nCreate a style from an hexadecimal color string:\n\n- `color.HEX(hex string, isBg ...bool) RGBColor`\n\n```go\nc := color.HEX(\"ccc\") // can also: \"cccccc\" \"#cccccc\"\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n\nc = color.HEX(\"aabbcc\", true) // as bg color\nc.Println(\"message\")\nc.Printf(\"format %s\", \"message\")\n```\n\n### RGB color style\n\nCan be used to set the foreground and background colors at the same time.\n\n- `color.NewRGBStyle(fg RGBColor, bg ...RGBColor) *RGBStyle`\n\n```go\ns := color.NewRGBStyle(RGB(20, 144, 234), RGB(234, 78, 23))\ns.Println(\"message\")\ns.Printf(\"format %s\", \"message\")\n```\n\nCreate a style from an hexadecimal color string:\n\n- `color.HEXStyle(fg string, bg ...string) *RGBStyle`\n\n```go\ns := color.HEXStyle(\"11aa23\", \"eee\")\ns.Println(\"message\")\ns.Printf(\"format %s\", \"message\")\n```\n\nwith options:\n\n```go\ns := color.HEXStyle(\"11aa23\", \"eee\")\ns.SetOpts(color.Opts{color.OpBold})\n\ns.Println(\"style with options\")\ns.Printf(\"style with %s\\n\", \"options\")\n```\n\n## HTML-like tag usage\n\n`Print,Printf,Println` functions support auto parse and render color tags.\n\n```go\n\ttext := `\n  \u003cmga1\u003egookit/color:\u003c/\u003e\n     A \u003cgreen\u003ecommand-line\u003c/\u003e \n     \u003ccyan\u003ecolor library\u003c/\u003e with \u003cfg=167;bg=232\u003e256-color\u003c/\u003e\n     and \u003cfg=11aa23;op=bold\u003eTrue-color\u003c/\u003e support,\n     \u003cfg=mga;op=i\u003euniversal API\u003c/\u003e methods\n     and \u003ccyan\u003eWindows\u003c/\u003e support.\n`\n\tcolor.Print(text)\n```\n\nPreview, code please see [_examples/demo_tag.go](_examples/demo_tag.go):\n\n![demo_tag](_examples/images/demo_tag.png)\n\n**Tag formats:**\n\n- Use built in tags: `\u003cTAG_NAME\u003eCONTENT\u003c/\u003e` e.g: `\u003cinfo\u003emessage\u003c/\u003e`\n- Custom tag attributes: `\u003cfg=VALUE;bg=VALUE;op=VALUES\u003eCONTENT\u003c/\u003e` e.g: `\u003cfg=167;bg=232\u003ewel\u003c/\u003e`\n\n\u003e **Supported** on Windows `cmd.exe` `PowerShell`.\n\nExamples:\n\n```go\n// use style tag\ncolor.Print(\"\u003csuc\u003ehe\u003c/\u003e\u003ccomment\u003ello\u003c/\u003e, \u003ccyan\u003ewel\u003c/\u003e\u003cred\u003ecome\u003c/\u003e\")\ncolor.Println(\"\u003csuc\u003ehello\u003c/\u003e\")\ncolor.Println(\"\u003cerror\u003ehello\u003c/\u003e\")\ncolor.Println(\"\u003cwarning\u003ehello\u003c/\u003e\")\n\n// custom color attributes\ncolor.Print(\"\u003cfg=yellow;bg=black;op=underscore;\u003ehello, welcome\u003c/\u003e\\n\")\n\n// Custom label attr: Supports the use of 16 color names, 256 color values, rgb color values and hex color values\ncolor.Println(\"\u003cfg=11aa23\u003ehe\u003c/\u003e\u003cbg=120,35,156\u003ello\u003c/\u003e, \u003cfg=167;bg=232\u003ewel\u003c/\u003e\u003cfg=red\u003ecome\u003c/\u003e\")\n```\n \n### Tag attributes\n\ntag attributes format:\n\n```text\nattr format:\n // VALUE please see var: FgColors, BgColors, AllOptions\n \"fg=VALUE;bg=VALUE;op=VALUE\"\n\n16 color:\n \"fg=yellow\"\n \"bg=red\"\n \"op=bold,underscore\" // option is allow multi value\n \"fg=white;bg=blue;op=bold\"\n \"fg=white;op=bold,underscore\"\n\n256 color:\n \"fg=167\"\n \"fg=167;bg=23\"\n \"fg=167;bg=23;op=bold\"\n \nTrue color:\n // hex\n \"fg=fc1cac\"\n \"fg=fc1cac;bg=c2c3c4\"\n // r,g,b\n \"fg=23,45,214\"\n \"fg=23,45,214;bg=109,99,88\"\n```\n\n\u003e tag attributes parse please see `func ParseCodeFromAttr()`\n\n### Built-in tags\n\nBuilt-in tags please see var `colorTags` in [color_tag.go](color_tag.go)\n\n```go\n// use style tag\ncolor.Print(\"\u003csuc\u003ehe\u003c/\u003e\u003ccomment\u003ello\u003c/\u003e, \u003ccyan\u003ewel\u003c/\u003e\u003cred\u003ecome\u003c/\u003e\")\ncolor.Println(\"\u003csuc\u003ehello\u003c/\u003e\")\ncolor.Println(\"\u003cerror\u003ehello\u003c/\u003e\")\n```\n\nRun demo: `go run ./_examples/color_tag.go`\n\n![color-tags](_examples/images/color-tags.png)\n\n**Use `color.Tag` build message**:\n\n```go\n// set a style tag\ncolor.Tag(\"info\").Print(\"info style text\")\ncolor.Tag(\"info\").Printf(\"%s style text\", \"info\")\ncolor.Tag(\"info\").Println(\"info style text\")\n```\n\n## Color convert\n\nSupports conversion between Rgb, 256, 16 colors, `Rgb \u003c=\u003e 256 \u003c=\u003e 16`\n\n```go\nbasic := color.Red\nbasic.Println(\"basic color\")\n\nc256 := color.Red.C256()\nc256.Println(\"256 color\")\nc256.C16().Println(\"basic color\")\n\nrgb := color.Red.RGB()\nrgb.Println(\"rgb color\")\nrgb.C256().Println(\"256 color\")\n```\n\n### Convert utils\n\n`color` has many built-in color conversion utility functions.\n\n```go\nfunc Basic2hex(val uint8) string\n\nfunc Bg2Fg(val uint8) uint8\nfunc Fg2Bg(val uint8) uint8\n\nfunc C256ToRgb(val uint8) (rgb []uint8)\nfunc C256ToRgbV1(val uint8) (rgb []uint8)\n\nfunc Hex2basic(hex string, asBg ...bool) uint8\nfunc Hex2rgb(hex string) []int\nfunc HexToRGB(hex string) []int\nfunc HexToRgb(hex string) (rgb []int)\n\nfunc HslIntToRgb(h, s, l int) (rgb []uint8)\nfunc HslToRgb(h, s, l float64) (rgb []uint8)\nfunc HsvToRgb(h, s, v int) (rgb []uint8)\n\nfunc Rgb2ansi(r, g, b uint8, isBg bool) uint8\nfunc Rgb2basic(r, g, b uint8, isBg bool) uint8\nfunc Rgb2hex(rgb []int) string\nfunc Rgb2short(r, g, b uint8) uint8\nfunc RgbTo256(r, g, b uint8) uint8\nfunc RgbTo256Table() map[string]uint8\nfunc RgbToAnsi(r, g, b uint8, isBg bool) uint8\nfunc RgbToHex(rgb []int) string\nfunc RgbToHsl(r, g, b uint8) []float64\nfunc RgbToHslInt(r, g, b uint8) []int\n```\n\n**Convert to `RGBColor`**:\n\n- `func RGBFromSlice(rgb []uint8, isBg ...bool) RGBColor`\n- `func RGBFromString(rgb string, isBg ...bool) RGBColor`\n- `func HEX(hex string, isBg ...bool) RGBColor`\n- `func HSL(h, s, l float64, isBg ...bool) RGBColor`\n- `func HSLInt(h, s, l int, isBg ...bool) RGBColor`\n\n## Util functions\n\nThere are some useful functions reference\n\n- `Disable()` disable color render\n- `SetOutput(io.Writer)` custom set the colored text output writer\n- `ForceOpenColor()` force open color render\n- `Colors2code(colors ...Color) string` Convert colors to code. return like \"32;45;3\"\n- `ClearCode(str string) string` Use for clear color codes\n- `ClearTag(s string) string` clear all color html-tag for a string\n- `IsConsole(w io.Writer)` Determine whether w is one of stderr, stdout, stdin\n\n\u003e More useful func please see https://pkg.go.dev/github.com/gookit/color\n\n### Detect color level\n\n`color` automatically checks the color levels supported by the current environment.\n\n```go\n// Level is the color level supported by a terminal.\ntype Level = terminfo.ColorLevel\n\n// terminal color available level alias of the terminfo.ColorLevel*\nconst (\n\tLevelNo  = terminfo.ColorLevelNone     // not support color.\n\tLevel16  = terminfo.ColorLevelBasic    // basic - 3/4 bit color supported\n\tLevel256 = terminfo.ColorLevelHundreds // hundreds - 8-bit color supported\n\tLevelRgb = terminfo.ColorLevelMillions // millions - (24 bit)true color supported\n)\n```\n\n- `func SupportColor() bool` Whether the current environment supports color output\n- `func Support256Color() bool` Whether the current environment supports 256-color output\n- `func SupportTrueColor() bool` Whether the current environment supports (RGB)True-color output\n- `func TermColorLevel() Level` Get the currently supported color level\n\n\n## Projects using color\n\nCheck out these projects, which use https://github.com/gookit/color :\n\n- https://github.com/Delta456/box-cli-maker Make Highly Customized Boxes for your CLI\n- https://github.com/flipped-aurora/gin-vue-admin 基于gin+vue搭建的（中）后台系统框架\n- https://github.com/JanDeDobbeleer/oh-my-posh A prompt theme engine for any shell.\n- https://github.com/jesseduffield/lazygit Simple terminal UI for git commands\n- https://github.com/olivia-ai/olivia 💁‍♀️Your new best friend powered by an artificial neural network  \n- https://github.com/pterm/pterm PTerm is a modern Go module to beautify console output. Featuring charts, progressbars, tables, trees, etc.\n- https://github.com/securego/gosec Golang security checker\n- https://github.com/TNK-Studio/lazykube ⎈ The lazier way to manage kubernetes.\n- [+ See More](https://pkg.go.dev/github.com/gookit/color?tab=importedby)\n\n## Gookit packages\n\n  - [gookit/ini](https://github.com/gookit/ini) Go config management, use INI files\n  - [gookit/rux](https://github.com/gookit/rux) Simple and fast request router for golang HTTP \n  - [gookit/gcli](https://github.com/gookit/gcli) build CLI application, tool library, running CLI commands\n  - [gookit/slog](https://github.com/gookit/slog) Concise and extensible go log library\n  - [gookit/event](https://github.com/gookit/event) Lightweight event manager and dispatcher implements by Go\n  - [gookit/cache](https://github.com/gookit/cache) Generic cache use and cache manager for golang. support File, Memory, Redis, Memcached.\n  - [gookit/config](https://github.com/gookit/config) Go config management. support JSON, YAML, TOML, INI, HCL, ENV and Flags\n  - [gookit/color](https://github.com/gookit/color) A command-line color library with true color support, universal API methods and Windows support\n  - [gookit/filter](https://github.com/gookit/filter) Provide filtering, sanitizing, and conversion of golang data\n  - [gookit/validate](https://github.com/gookit/validate) Use for data validation and filtering. support Map, Struct, Form data\n  - [gookit/goutil](https://github.com/gookit/goutil) Some utils for the Go: string, array/slice, map, format, cli, env, filesystem, test and more\n  - More, please see https://github.com/gookit\n\n## See also\n\n  - [inhere/console](https://github.com/inhere/php-console)\n  - [xo/terminfo](https://github.com/xo/terminfo)\n  - [beego/bee](https://github.com/beego/bee)\n  - [issue9/term](https://github.com/issue9/term)\n  - [muesli/termenv](https://github.com/muesli/termenv)\n  - [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code)\n  - [Standard ANSI color map](https://conemu.github.io/en/AnsiEscapeCodes.html#Standard_ANSI_color_map)\n  - [Terminal Colors](https://gist.github.com/XVilka/8346728)\n\n## License\n\n[MIT](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgookit%2Fcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgookit%2Fcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgookit%2Fcolor/lists"}