colourize

package module
v0.0.0-...-2c32423 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 3 Imported by: 4

README

colourize

GoDoc Build Status Coverage Status Go Report Card

An ANSI colour terminal package for Go. Supports all ANSI colours and emphasis. Not compatible with Windows systems.

Project is no longer maintained.

This project is no longer maintained. However it's also complete. It has not and will not be updated with new Go features.

Installation

 go get github.com/TreyBastian/colourize 

Usage

package main
import (
    c "github.com/TreyBastian/colourize"
    "fmt"
)

func main() {
  fmt.Println(c.Colourize("Hello World!", c.Green, c.Whitebg, c.Bold))
}

Projects Using colourize

Documentation

Overview

Package colourize implements simple ANSI colour codes to style terminal output text.

Index

Constants

View Source
const (
	//Text Colour
	Black   = 30
	Red     = 31
	Green   = 32
	Yellow  = 33
	Blue    = 34
	Magenta = 35
	Cyan    = 36
	White   = 37
	Grey    = 90

	//Background Colour
	Blackbg   = 40
	Redbg     = 41
	Greenbg   = 42
	Yellowbg  = 43
	Bluebg    = 44
	Magentabg = 45
	Cyanbg    = 46
	Whitebg   = 47

	//Style
	Bold      = 1
	Dim       = 2
	Italic    = 3
	Underline = 4
	Blinkslow = 5
	Blinkfast = 6
	Inverse   = 7
	Hidden    = 8
	Strikeout = 9
)

Colour Styles

Variables

This section is empty.

Functions

func Colourize

func Colourize(s interface{}, style ...int) string

Colourize is the function that provides colours for values passed to it. package main

import(

c "github.com/TreyBastian/colourize"
"fmt"

)

func main() {
	fmt.Println(c.Colourize("Hello", c.Cyan))
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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