https://github.com/a-poor/golors
A tiny golang package for formatting text in the terminal.
https://github.com/a-poor/golors
bash-colors colors go golang
Last synced: 11 months ago
JSON representation
A tiny golang package for formatting text in the terminal.
- Host: GitHub
- URL: https://github.com/a-poor/golors
- Owner: a-poor
- License: mit
- Created: 2021-06-30T16:55:20.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T22:59:37.000Z (almost 5 years ago)
- Last Synced: 2025-07-01T12:57:42.743Z (11 months ago)
- Topics: bash-colors, colors, go, golang
- Language: Go
- Homepage: https://pkg.go.dev/github.com/a-poor/golors
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golors
[](https://pkg.go.dev/github.com/a-poor/golors)
_created by Austin Poor_
A tiny go package for printing colorful text to the terminal.
Functions wrap `fmt.Print` and `fmt.Println` for the following colors:
* Red
* Green
* Yellow
* Blue
* Purple
* Cyan
* Gray
* Grey (alias of Gray)
* White
## Example
```go
package main
import "github.com/a-poor/golors"
func main() {
// Print red text and a new-line character
golors.Redln("This text is red!")
// These three commands print a single line "whitecyanpurple"
// but where each word is the correct color
golors.White("white")
golors.Cyan("cyan")
golors.Purpleln("purple")
}
```
And the result is:

## ToDo
Include more colors, background colors, and text styles (_ie_ bold, faint, italics, and underlined)
[Reference article](https://dev.to/ifenna__/adding-colors-to-bash-scripts-48g4)