color

package module
v0.0.0-...-31d518c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2013 License: MIT Imports: 0 Imported by: 58

README

color

Package color provides functions to generate colored text using ANSI color codes.

Documentation

Overview

Package color provides functions to generate colored text using ANSI color codes.

For more information, refer to http://en.wikipedia.org/wiki/ANSI_escape_code#Colors

Index

Constants

This section is empty.

Variables

View Source
var ANSI ansi

ANSI implements the Color interface, it generates ANSI escape code to control text color.

View Source
var NoColor nocolor

NoColor implements the Color interface, it makes no transformation to the text.

Functions

func Blue

func Blue(s string) string

func Cyan

func Cyan(s string) string

func Green

func Green(s string) string

func Magenta

func Magenta(s string) string

func Red

func Red(s string) string

func SetDefaultColor

func SetDefaultColor(c Color)

SetDefaultColor changes the color implementation used by global color function in this package.

func Yellow

func Yellow(s string) string

Types

type Color

type Color interface {
	Red(string) string
	Green(string) string
	Yellow(string) string
	Blue(string) string
	Magenta(string) string
	Cyan(string) string
}

A Color specifies how to generated colored text.

Jump to

Keyboard shortcuts

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