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).
| Name | Preview |
|---|---|
| rainbow | on going... |
| pulse | on going... |
| glitch | on going... |
| radar | on going... |
| neon | ![]() |
- Install
- Example
- Hex
- FromInt32
- Iterables
- Modifiers
BoldDimItalicUnderlineReverseHidden
- Colors
BlackRedGreenYellowBlueMagentaCyanWhiteRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhiteBright
- Background Colors
BgBlackBgRedBgGreenBgYellowBgBlueBgMagentaBgCyanBgWhiteBgBlackBrightBgRedBrightBgGreenBrightBgYellowBrightBgBlueBrightBgMagentaBrightBgCyanBrightBgWhiteBright
- Animations
Neon
go get github.com/raphamorim/go-rainbowmain.go
package main
import (
"fmt"
"github.com/raphamorim/go-rainbow"
)
func main() {
fmt.Println(rainbow.Bold(rainbow.Hex("#8E44AD", "raphael")))
}ftm.Printf("%s", rainbow.Hex("#000080", "String from HEX")) // should be index 4 (navy blue)32-bit unsigned integer equivalent (uint32)
fmt.Printf("%s", rainbow.FromInt32(0xCC66FFFF, "String from Int32"))rainbow.Bold("String in Bold")BoldDimItalic (Not widely supported)UnderlineReverseHiddenStrikethrough (Not widely supported)
rainbow.Blue("String in Blue")BlackRedGreenYellowBlueMagentaCyanWhiteRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhiteBright
Gray
rainbow.BgBlue("String in Blue Background")BgBlackBgRedBgGreenBgYellowBgBlueBgMagentaBgCyanBgWhiteBgBlackBrightBgRedBrightBgGreenBrightBgYellowBrightBgBlueBrightBgMagentaBrightBgCyanBrightBgWhiteBright
abc := Bold(BgYellow(Blue("Bold+BgYellow+Blue")))
xyz := Dim(Underscore("Dim+Underscore"))Animations have a different behavior of all methods, they realize the act of print, instead of only returning string.
code
rainbow.Animation("AWESOME NEON ANIMATION", "neon")sample
rainbow.RGB(100, 110, 100)The MIT License (MIT) - see LICENSE.md for more details



