{"id":37179725,"url":"https://github.com/lorossi/colorize","last_synced_at":"2026-01-14T20:54:39.337Z","repository":{"id":57568527,"uuid":"342026570","full_name":"lorossi/colorize","owner":"lorossi","description":"Simple Go package to have colored and formatted text inside your terminal","archived":false,"fork":false,"pushed_at":"2021-04-08T22:16:41.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-27T22:19:37.985Z","etag":null,"topics":["colors","go-package","golang-package","released","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lorossi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-24T20:27:06.000Z","updated_at":"2021-03-03T08:51:12.000Z","dependencies_parsed_at":"2022-08-30T05:50:24.630Z","dependency_job_id":null,"html_url":"https://github.com/lorossi/colorize","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/lorossi/colorize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorossi%2Fcolorize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorossi%2Fcolorize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorossi%2Fcolorize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorossi%2Fcolorize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lorossi","download_url":"https://codeload.github.com/lorossi/colorize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorossi%2Fcolorize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"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":["colors","go-package","golang-package","released","terminal"],"created_at":"2026-01-14T20:54:38.563Z","updated_at":"2026-01-14T20:54:39.327Z","avatar_url":"https://github.com/lorossi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Colorize\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/examples/readmedemo.png\"\u003e  \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://img.shields.io/github/repo-size/lorossi/colorize?style=flat-square\"\u003e\n   \u003cimg src=\"https://img.shields.io/maintenance/yes/2021?style=flat-square\"\u003e\n   \u003cimg src=\"https://img.shields.io/github/last-commit/lorossi/colorize/main?style=flat-square\"\u003e\n   \u003cimg src=\"https://img.shields.io/github/v/release/lorossi/colorize?style=flat-square\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cspan style=\"font-size:larger;\"\u003eColorize is a simple and handy Go package that lets you use colors and styling in your console!\u003c/span\u003e\n\u003c/p\u003e\n\n## Installation\n\n```bash\ngo get github.com/lorossi/colorize\n\n```\n\n## Documentation\n\n[Read the docs here!](/DOCS.md)\n\nThis package uses no dependancies exluding the built-in functions.\n\nThere are a lot of packages similar (and even better!) than this one. But since I wanted to use colored terminal for my project [Journal](https://www.github.com/lorossi/journal), I decided to make my own package, as a learning experience. I don't regret it at all. It's been fun so far.\n\n## Examples\n\nSet the style manually:\n\n```go\ncolorize.SetStyle(colorize.Bold, colorize.FgBrightBlue, colorize.BgBrightYellow)\nFmt.Println(\"WOW\")\ncolorize.ResetStyle()\n```\nSet an rgb value for the text:\n\n```go\ncolorize.SetFgRGB(255, 0, 0)\nFmt.Println(\"Colored!\")\ncolorize.ResetStyle()\n```\n\nSet an rgb value for the background:\n\n```go\ncolorize.SetBgRGB(0, 255, 0)\nFmt.Println(\"Now is green!\")\ncolorize.ResetStyle()\n```\n\nSet truecolors text and background colors! This gives the users more colors than its rgb counterpart but it's less supported (Win10 powershell and linux terminal support this):\n\n```go\ncolorize.SetFgTruecolor(255, 255, 0)\ncolorize.SetBgTruecolor(0, 0, 255)\nFmt.Println(\"Everything is so colorful!\")\ncolorize.ResetStyle()\n```\n\nSet color by HSL values:\n\n```go\ncolorize.SetFgTruecolorHSL(92, 255, 127)\ncolorize.SetBgTruecolorHSL(112, 255, 127)\nfmt.Println(\"RED on GREEN!\")\ncolorize.ResetStyle()\n```\n\n**Never foget to reset the style via the `ResetStyle()` function!**\n\nSet a text color, background color or style with the quick functions:\n\n```go\nfmt.Println(colorize.Green(\"Green text!\", 123, \"also green numbers!\"))\nfmt.Println(colorize.BrightMagentaBg(\"So magenta and so bright!\"))\nfmt.Println(colorize.Bold(\"This is so bold!\"))\n```\n\nIf you need to style only a string with default constants (no RGB, HSL or Truetype) you can also use the oneliner function:\n\n```go\nfmt.Println(StyleText(\"This is waaay faster!\",  colorize.FgBrightWhite, colorize.BgBlue, colorize.Bold, colorize.Underline))\ns := StyleText(\"This is the opposite!\",  colorize.FgBlue, colorize.BgBrightWhite, colorize.Bold, colorize.Underline)\nfmt.Println(s)\n```\n\nNote that there's no need to reset the style later on.\n\n**See a few more examples [here.](/examples/main.go)**\n\n## List of constants\n\n### Text color constants\n\n```go\nFgBlack\nFgRed\nFgGreen\nFgYellow\nFgBlue\nFgMagenta\nFgCyan\nFgWhite\nFgBrightBlack\nFgBrightRed\nFgBrightGreen\nFgBrightYellow\nFgBrightBlue\nFgBrightMagenta\nFgBrightCyan\nFgBrightWhite\n```\n\n### Backgroud color constants\n\n```go\nBgBlack\nBgRed\nBgGreen\nBgYellow\nBgBlue\nBgMagenta\nBgCyan\nBgWhite\nBgBrightBlack\nBgBrightRed\nBgBrightGreen\nBgBrightYellow\nBgBrightBlue\nBgBrightMagenta\nBgBrightCyan\nBgBrightWhite\n```\n\n### Text decoration constants\n\n```go\nBold\nFaint\nItalic\nUnderline\nSlowBlink\nRapidBlink\nInvert\nHide\nStrike\nFramed  // Not widely supported\nEncircled // Not widely supported\n```\n\n## Quick functions\n\n### Text color functions\n\n```go\nRed()\nGreen()\nYellow()\nBlue()\nMagenta()\nCyan()\nWhite()\nBrightRed()\nBrightGreen()\nBrightYellow()\nBrightBlue()\nBrightMagenta()\nBrightCyan()\nBrightWhite()\n```\n\n### Background color functions\n\n```go\nRedBg()\nGreenBg()\nYellowBg()\nBlueBg()\nMagentaBg()\nCyanBg()\nWhiteBg()\nBrightRedBg()\nBrightGreenBg()\nBrightYellowBg()\nBrightBlueBg()\nBrightMagentaBg()\nBrightCyanBg()\nBrightWhiteBg()\n```\n\n### Text decoration functions\n\n```go\nBoldStyle()\nFaintStyle()\nItalicStyle()\nUnderlineStyle()\nSlowBlinkStyle()\nRapidBlinkStyle()\nInvertStyle()\nHideStyle()\nStrikeStyle()\nFramedStyle() // Not widely supported\nEncircledStyle()  // Not widely supported\n```\n\n## License\n\nThis project is distributed under CC 4.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florossi%2Fcolorize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florossi%2Fcolorize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florossi%2Fcolorize/lists"}