Documentation ¶
Overview ¶
Color is a library for colouring things.
Installation ¶
Install the cli with:
go get github.com/jpedro/color/cli/color
Usage ¶
Sample code:
package main import ( "fmt" "github.com/jpedro/color" ) func main() { fmt.Println(color.Green("Hello %s!", "lush green")) }
Index ¶
- func Blue(text interface{}, args ...interface{}) string
- func Cyan(text interface{}, args ...interface{}) string
- func Gray(text interface{}, args ...interface{}) string
- func Green(text interface{}, args ...interface{}) string
- func Magenta(text interface{}, args ...interface{}) string
- func Paint(color string, text interface{}, args ...interface{}) string
- func Pale(text interface{}, args ...interface{}) string
- func Parse(text string, args ...interface{}) string
- func Red(text interface{}, args ...interface{}) string
- func Yellow(text interface{}, args ...interface{}) string
- type Color
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blue ¶ added in v0.1.12
func Blue(text interface{}, args ...interface{}) string
Shortcut for color.Paint("blue", text)
func Cyan ¶ added in v0.1.12
func Cyan(text interface{}, args ...interface{}) string
Shortcut for color.Paint("cyan", text)
func Gray ¶ added in v0.1.15
func Gray(text interface{}, args ...interface{}) string
Shortcut for color.Paint("gray", text)
func Green ¶ added in v0.1.12
func Green(text interface{}, args ...interface{}) string
Shortcut for color.Paint("green", text)
func Magenta ¶ added in v0.1.12
func Magenta(text interface{}, args ...interface{}) string
Shortcut for color.Paint("magenta", text)
func Pale ¶ added in v0.1.16
func Pale(text interface{}, args ...interface{}) string
Shortcut for color.Paint("pale", text)
func Parse ¶ added in v0.1.16
Returns a painted string with groups like `{green|this should be green}` replaced with `this should be green` in green color
Types ¶
type Color ¶ added in v0.1.17
type Color struct {
// contains filtered or unexported fields
}
func (*Color) Background ¶ added in v0.1.17
Select a color for your background
func (*Color) Foreground ¶ added in v0.1.17
Select a color for your foreground
Click to show internal directories.
Click to hide internal directories.