Go rainbow
Golang Helper for beautiful CLI Applications
Extremely inspired by [chalk.js](https://github.com/chalk/chalk) The project is written primarily in Go, distributed under the MIT License license, first published in 2017. Key topics include: cli, colorization, colors, golang, hex.
go-rainbow 
Extremely inspired by chalk.js
go-rainbow allows you to:
- Iterate modifiers and colors on a String.
- Use HEX as you wish.
- Use from Int as you wish.
- Use RGB as you wish (work in progress).
- Bring magical Rainbow on a String (work in progress).

Available animations
| Name | Preview |
|---|---|
| rainbow | on going... |
| pulse | on going... |
| glitch | on going... |
| radar | on going... |
| neon | ![]() |
Summary
- Install
- Example
- Hex
- FromInt32
- Iterables
- Modifiers
BoldDimItalicUnderlineReverseHidden
- Colors
BlackRedGreenYellowBlueMagentaCyanWhiteRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhiteBright
- Background Colors
BgBlackBgRedBgGreenBgYellowBgBlueBgMagentaBgCyanBgWhiteBgBlackBrightBgRedBrightBgGreenBrightBgYellowBrightBgBlueBrightBgMagentaBrightBgCyanBrightBgWhiteBright
- Animations
Neon
Install
bashgo get github.com/raphamorim/go-rainbow
Example
main.go
gopackage main import ( "fmt" "github.com/raphamorim/go-rainbow" ) func main() { fmt.Println(rainbow.Bold(rainbow.Hex("#8E44AD", "raphael"))) }

Hex
goftm.Printf("%s", rainbow.Hex("#000080", "String from HEX")) // should be index 4 (navy blue)
FromInt32
32-bit unsigned integer equivalent (uint32)
gofmt.Printf("%s", rainbow.FromInt32(0xCC66FFFF, "String from Int32"))
Modifiers
Usage
gorainbow.Bold("String in Bold")
BoldDimItalic (Not widely supported)UnderlineReverseHiddenStrikethrough (Not widely supported)
Colors
Usage
gorainbow.Blue("String in Blue")
List
BlackRedGreenYellowBlueMagentaCyanWhiteRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhiteBright
Soon (send a PR to help us!):
Gray
Background Colors
gorainbow.BgBlue("String in Blue Background")
List
BgBlackBgRedBgGreenBgYellowBgBlueBgMagentaBgCyanBgWhiteBgBlackBrightBgRedBrightBgGreenBrightBgYellowBrightBgBlueBrightBgMagentaBrightBgCyanBrightBgWhiteBright
Iterables
goabc := Bold(BgYellow(Blue("Bold+BgYellow+Blue"))) xyz := Dim(Underscore("Dim+Underscore"))
Animations
Animations have a different behavior of all methods, they realize the act of print, instead of only returning string.
Neon
code
gorainbow.Animation("AWESOME NEON ANIMATION", "neon")
sample

RGB (working on it)
gorainbow.RGB(100, 110, 100)
License
The MIT License (MIT) - see LICENSE.md for more details
Contributors
Showing top 5 contributors by commit count.
This article is auto-generated from raphamorim/go-rainbow via the GitHub API.Last fetched: 6/27/2026

