{"id":13409956,"url":"https://github.com/abusomani/go-palette","last_synced_at":"2026-03-09T20:37:47.565Z","repository":{"id":114960131,"uuid":"609217049","full_name":"abusomani/go-palette","owner":"abusomani","description":"Decorate your terminals using Palette 🎨","archived":false,"fork":false,"pushed_at":"2023-03-09T13:54:57.000Z","size":2125,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-22T13:31:51.544Z","etag":null,"topics":["ansi","ansi-colors","ansi-escape-codes","cli","go","golang","golang-library","style"],"latest_commit_sha":null,"homepage":"","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/abusomani.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}},"created_at":"2023-03-03T16:10:49.000Z","updated_at":"2023-09-29T08:12:02.000Z","dependencies_parsed_at":"2024-01-07T22:03:58.783Z","dependency_job_id":null,"html_url":"https://github.com/abusomani/go-palette","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/abusomani/go-palette","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abusomani%2Fgo-palette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abusomani%2Fgo-palette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abusomani%2Fgo-palette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abusomani%2Fgo-palette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abusomani","download_url":"https://codeload.github.com/abusomani/go-palette/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abusomani%2Fgo-palette/sbom","scorecard":{"id":162063,"data":{"date":"2025-08-11","repo":{"name":"github.com/abusomani/go-palette","commit":"7d38713ba8b2c87e3d3c12c532253dff6a7bb3f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint-soft.yml:7","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/lint-soft.yml:9","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:7","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/lint.yml:9","Warn: no topLevel permission defined: .github/workflows/renew-documentation.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-soft.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint-soft.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-soft.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint-soft.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint-soft.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint-soft.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/renew-documentation.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/abusomani/go-palette/renew-documentation.yml/main?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/coverage.yml:29","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T13:45:46.055Z","repository_id":114960131,"created_at":"2025-08-16T13:45:46.055Z","updated_at":"2025-08-16T13:45:46.055Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30310988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ansi","ansi-colors","ansi-escape-codes","cli","go","golang","golang-library","style"],"created_at":"2024-07-30T20:01:04.220Z","updated_at":"2026-03-09T20:37:47.517Z","avatar_url":"https://github.com/abusomani.png","language":"Go","funding_links":[],"categories":["Go","Command Line","命令行","Build Automation"],"sub_categories":["Advanced Console UIs","高级控制台用户界面"],"readme":"\u003cdiv align=\"center\" id=\"top\"\u003e \n  \u003cimg src=\"https://res.cloudinary.com/dahkenlmo/image/upload/v1678038121/gopher_jftcse.png\" alt=\"Go-Palette\" /\u003e\n  \u0026#xa0;\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003eGo-Palette 🎨\u003c/h1\u003e\n\n\n[![Build Status](https://github.com/abusomani/go-palette/workflows/build/badge.svg)](https://github.com/abusomani/go-palette/actions)\n[![Github top language](https://img.shields.io/github/languages/top/abusomani/go-palette)](https://img.shields.io/github/languages/top/abusomani/go-palette)\n[![Github language count](https://img.shields.io/github/languages/count/abusomani/go-palette)](https://img.shields.io/github/languages/count/abusomani/go-palette)\n[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/abusomani/go-palette/blob/main/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/abusomani/go-palette)](https://goreportcard.com/report/github.com/abusomani/go-palette)\n[![Go Reference](https://pkg.go.dev/badge/github.com/abusomani/go-palette.svg)](https://pkg.go.dev/github.com/abusomani/go-palette)\n[![Coverage Status](https://coveralls.io/repos/github/abusomani/go-palette/badge.svg?branch=main)](https://coveralls.io/github/abusomani/go-palette?branch=main)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#advanced-console-uis)\n\nElegant and convenient style definitions using ANSI colors. \nFully compatible and wraps the `fmt` [library](https://pkg.go.dev/fmt) for nice terminal layouts. \n\n\n\u003cdiv align=\"center\" id=\"top\"\u003e \n  \u003cimg src=\"https://res.cloudinary.com/dahkenlmo/image/upload/v1678038121/go-palette-example_q5w01k.png\" alt=\"Output of running the example written using Go-palette\" /\u003e\n\u003c/div\u003e\n\n## Supported Colors \u0026 Formats\n\n### Standard colors\n\n![standard colors](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038120/standard-colors_kbxyyi.png)\n\nThe following colors are supported to be used by their names for both foreground and background as shown in [Example using color names](#example-using-color-names)\n\n| Color Name    | Color Code  |\n| :---          |    :----:  |\n| Black         |   0   |\n| Red           |   1   |\n| Green         |   2   |\n| Yellow        |   3   |\n| Blue          |   4   |\n| Magenta       |   5   |\n| Cyan          |   6   |\n| White         |   7   |\n| BrightBlack   |   8   |\n| BrightRed     |   9   |\n| BrightGreen   |   10  |\n| BrightYellow  |   11  |\n| BrightBlue    |   12  |\n| BrightMagenta |   13  |\n| BrightCyan    |   14  |\n| BrightWhite   |   15  |\n\n#### Standard colors used as foreground as well as background\n![standard colors used as foreground as well as background](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038120/standard-colors-fg-bg_vxr67y.png)\n\n\n### Supported Foreground Palette\nThe following palette is supported as foreground/text colors. The numbers represent the color-codes which can be used as shown in [Example using color codes](#example-using-color-codes).\n\n![complete supported foreground palette](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038121/foreground-palette_klb2o4.png)\n\n### Supported Background Palette\n\nThe following palette is supported as background colors. The numbers represent the color-codes which can be used as shown in [Example using color codes](#example-using-color-codes).\n\n![complete supported background palette](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038122/background-palette_neiykd.png)\n\n### Supported Text Formats\n\nThe following text formats are supported.\n- Reset\n- Bold\n- Dim\n- Italic\n- Underline\n- SlowBlink\n- Hidden\n- Strikethrough\n\n![supported text formats](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038120/special-effects_bwuurg.gif)\n\n## Prerequisites\n\nA go module where you want to integrate go-palette. To create one, follow this [guide](https://go.dev/doc/tutorial/create-module).\n\n## Installation\n\n```\ngo get github.com/abusomani/go-palette\n```\n\n\n## Usage\n\nAfter installing the `go-palette` package, we start using it the following way.\n\n### Import\n\nA very useful feature of Go’s import statement are aliases. A common use case for import aliases is to provide a shorter alternative to a library’s package name.\n\nIn this example, we save ourselves having to type `palette` everytime we want to call one of the library’s functions, we just use `pal` instead.\n\n```go\nimport (\n    pal \"github.com/abusomani/go-palette/palette\"\n)\n```\n\n#### Example using Color names\n\n```go\npackage main\n\nimport (\n\tpal \"github.com/abusomani/go-palette/palette\"\n)\n\nfunc main() {\n\tp := pal.New()\n\tp.Println(\"This text is going to be in default color.\")\n\tp.SetOptions(pal.WithBackground(pal.Color(pal.BrightYellow)), pal.WithForeground(pal.Black))\n\tp.Println(\"This text is going to be in black color with a yellow background.\")\n}\n\n```\n**Output**\n\n![Code output](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038119/code-output_lup9j1.png)\n\n\n#### Example using Color codes\n\n```go\npackage main\n\nimport (\n\tpal \"github.com/abusomani/go-palette/palette\"\n)\n\nfunc main() {\n\tp := pal.New()\n\tp.Println(\"This text is going to be in default color.\")\n\t// We can use color codes from the palette to set as foreground and background colors\n\tp.SetOptions(pal.WithBackground(pal.Color(11)), pal.WithForeground(0))\n\tp.Println(\"This text is going to be in black color with a yellow background.\")\n}\n\n```\n\n**Output**\n\n![Code output](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038119/code-output_lup9j1.png)\n\n\n#### Example using Special effects\n\n```go\npackage main\n\nimport (\n\tpal \"github.com/abusomani/go-palette/palette\"\n)\n\nfunc main() {\n\tp := pal.New(pal.WithSpecialEffects([]pal.Special{pal.Bold}))\n\tp.Println(\"Bold\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.Dim}))\n\tp.Println(\"Dim\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.Italic}))\n\tp.Println(\"Italic\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.Underline}))\n\tp.Println(\"Underline\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.SlowBlink}))\n\tp.Println(\"SlowBlink\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.Hidden}))\n\tp.Print(\"Hidden\")\n\tp.SetOptions(pal.WithDefaults())\n\tp.Println(\"\u003c-Hidden\")\n\tp.SetOptions(pal.WithSpecialEffects([]pal.Special{pal.Strikethrough}))\n\tp.Println(\"Strikethrough\")\n}\n\n```\n\n### Flush\n\nFlush resets the Palette options with default values and disables the Palette.\n\n```go\npackage main\n\nimport (\n\tpal \"github.com/abusomani/go-palette/palette\"\n)\n\nfunc main() {\n\tp := pal.New()\n\tp.Println(\"This text is going to be in default color.\")\n\t// We can use color codes from the palette to set as foreground and background colors\n\tp.SetOptions(pal.WithBackground(pal.BrightMagenta), pal.WithForeground(pal.Black))\n\tp.Println(\"This text is going to be in black color with a bright magenta background.\")\n\tp.Flush()\n\tp.Println(\"This text is going to be in default color.\")\n}\n\n```\n**Output**\n\n![Flush output](https://res.cloudinary.com/dahkenlmo/image/upload/v1678038120/flush-code-output_ejrzoh.png)\n\n## Limitations\n\n### Windows\nGo-Palette provides ANSI colors only. Windows does not support ANSI out of the box. To toggle the ANSI color support follow the steps listed in this [superuser thread](https://superuser.com/questions/413073/windows-console-with-ansi-colors-handling).\n\n### Different behaviours in special effects\nGo-Palette provides styled support using ANSI Color codes through escape sequences. This varies between different Terminals based on its setting. Refer [ANSI Escape Codes](https://en.wikipedia.org/wiki/ANSI_escape_code) for more details.\n\n\n## License\nLicensed under [MIT](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabusomani%2Fgo-palette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabusomani%2Fgo-palette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabusomani%2Fgo-palette/lists"}