colors

package module
v0.0.0-...-e551865 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 1 Imported by: 3

README

Colors GitHub GoDoc Build Status

Colors lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang).

Support for windows untested/coming some day.

Install

go get github.com/codewinks/go-colors

Examples

import (
  "github.com/codewinks/go-colors"
)

func main(){
  colors.ShowExample()
}
Standard colors
	fmt.Println(colors.Green("Prints text in green."))
	fmt.Printf("Prints %s in blue.\n", colors.Blue("text"))

	fmt.Printf("Different colors such as %s, %s, %s, and %s.\n", colors.Blue("blue"), colors.Green("green"), colors.Red("red"), colors.Yellow("yellow"))

License

The MIT License (MIT) - see LICENSE.md for more details

Documentation

Index

Constants

View Source
const BLACK = "\033[0;30m"

BLACK – BLACK

View Source
const BLACKBOLD = "\033[1;30m"

BLACKBOLD – BLACKBOLD

View Source
const BLUE = "\033[0;34m"

BLUE – BLUE

View Source
const BLUEBOLD = "\033[1;34m"

BLUEBOLD – BLUEBOLD

View Source
const BOLD = "\033[1m"

BOLD – BOLD

View Source
const CYAN = "\033[0;36m"

CYAN – CYAN

View Source
const CYANBOLD = "\033[1;36m"

CYANBOLD – CYANBOLD

View Source
const GREEN = "\033[0;32m"

GREEN – GREEN

View Source
const GREENBOLD = "\033[1;32m"

GREENBOLD – GREENBOLD

View Source
const NC = "\033[0m"

NC – Reset Color

View Source
const PURPLE = "\033[0;35m"

PURPLE – PURPLE

View Source
const PURPLEBOLD = "\033[1;35m"

PURPLEBOLD – PURPLEBOLD

View Source
const RED = "\033[0;31m"

RED – RED

View Source
const REDBOLD = "\033[1;31m"

REDBOLD – REDBOLD

View Source
const WHITE = "\033[0;37m"

WHITE – WHITE

View Source
const WHITEBOLD = "\033[1;37m"

WHITEBOLD – WHITEBOLD

View Source
const YELLOW = "\033[0;33m"

YELLOW – YELLOW

View Source
const YELLOWBOLD = "\033[1;33m"

YELLOWBOLD – YELLOWBOLD

Variables

This section is empty.

Functions

func Black

func Black(text string) string

Black – Output text in Black

func BlackBold

func BlackBold(text string) string

BlackBold – Output text in BlackBold

func Blue

func Blue(text string) string

Blue – Output text in Blue

func BlueBold

func BlueBold(text string) string

BlueBold – Output text in BlueBold

func Bold

func Bold(text string) string

Bold – Output text in Bold

func Cyan

func Cyan(text string) string

Cyan – Output text in Cyan

func CyanBold

func CyanBold(text string) string

CyanBold – Output text in CyanBold

func Get

func Get(color string, text string) string

Get – Returns formatted text with color

func Green

func Green(text string) string

Green – Output text in Green

func GreenBold

func GreenBold(text string) string

GreenBold – Output text in GreenBold

func Purple

func Purple(text string) string

Purple – Output text in Purple

func PurpleBold

func PurpleBold(text string) string

PurpleBold – Output text in PurpleBold

func Red

func Red(text string) string

Red – Output text in Red

func RedBold

func RedBold(text string) string

RedBold – Output text in RedBold

func ShowExample

func ShowExample()

ShowExample - Print out all different colors that are supported

func White

func White(text string) string

White – Output text in White

func WhiteBold

func WhiteBold(text string) string

WhiteBold – Output text in WhiteBold

func Yellow

func Yellow(text string) string

Yellow – Output text in Yellow

func YellowBold

func YellowBold(text string) string

YellowBold – Output text in YellowBold

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL