termcolours

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

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

Go to latest
Published: Oct 31, 2017 License: BSD-3-Clause Imports: 3 Imported by: 8

README

go-termcolours

ANSI colour escape codes for Go.

Installation

go get -u github.com/thijzert/go-termcolours

Usage

package main

import (
	"fmt"
	"github.com/thijzert/go-termcolours" tc
)

func main() {
	fmt.Printf( "This is %s; this is %s.\n", tc.Green("green"), tc.Blue("blue") )
}

License

This repository is shared under a BSD 3-clause license. See the file COPYING for details.

Documentation

Index

Constants

View Source
const ESC = '\x1b'

Variables

View Source
var TerminalSupports24Bit bool = false

Functions

func Background24

func Background24(c color.Color, s string) string

func Background8

func Background8(colour C256, s string) string

func Bblack

func Bblack(s string) string

Bright or bold colours:

func Bblue

func Bblue(s string) string

func Bcyan

func Bcyan(s string) string

func Bgreen

func Bgreen(s string) string

func Black

func Black(s string) string

'Normal' colours:

func Blue

func Blue(s string) string

func Bpurple

func Bpurple(s string) string

func Bred

func Bred(s string) string

func Bwhite

func Bwhite(s string) string

func Byellow

func Byellow(s string) string

func Cyan

func Cyan(s string) string

func Foreground24

func Foreground24(c color.Color, s string) string

func Foreground8

func Foreground8(colour C256, s string) string

func Green

func Green(s string) string

func Purple

func Purple(s string) string

func Red

func Red(s string) string

func White

func White(s string) string

func Yellow

func Yellow(s string) string

Types

type C256

type C256 uint8

A 256-colour type. C256 implements image/color.Color

func Colour256

func Colour256(r, g, b int) C256

func Convert256

func Convert256(col color.Color) C256

func (C256) RGBA

func (c C256) RGBA() (r, g, b, a uint32)

Directories

Path Synopsis
bin

Jump to

Keyboard shortcuts

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