Skip to content

bentranter/chalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chalk

GoDoc

Build Status

Colour your terminal strings. Inspired by Node's Chalk

Features

  1. The eight default terminal colours

Usage

Get the package:

$ go get -u github.com/bentranter/chalk

Use it:

package main

import (
    "fmt"
    "github.com/bentranter/chalk"
)

func main() {
    // Look at the colours!
    fmt.Println(
        (chalk.Black("Black")),
        (chalk.Red("Red")),
        (chalk.Yellow("Yellow")),
        (chalk.Green("Green")),
        (chalk.Blue("Blue")),
        (chalk.Magenta("Magenta")),
        (chalk.Cyan("Cyan")),
        (chalk.White("White")),
    )

    // You can change the background colour too!
    fmt.Println(
        (chalk.BgBlue("My background is blue."))
    )

    // Or underline words
    fmt.Println(
        (chalk.Underline("I'm underlined!"))
    )
}

License

Licensed under Apache 2.0. Copyright 2016-2017 Ben Tranter. See license.md.

About

Colour your terminal strings (in Go, on Mac OS X)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages