colorterm

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 3 Imported by: 2

README

go-colorterm

LICENSE Go Reference Go Report Card

Enable ANSI escape sequence support on Windows.

Usage

package main

import "github.com/cions/go-colorterm"

func main() {
	fmt.Printf("%vred text%v\n", colorterm.FgRed, colorterm.Reset)
}

License

MIT

Documentation

Overview

Package colorterm enables ANSI escape sequence support on Windows.

Index

Constants

This section is empty.

Variables

View Source
var (
	Escape = '\x1b'
	CSI    = "\x1b["
)
View Source
var (
	Reset = EscapeCode("\x1b[0m")

	FgBlack   = EscapeCode("\x1b[30m")
	FgRed     = EscapeCode("\x1b[31m")
	FgGreen   = EscapeCode("\x1b[32m")
	FgYellow  = EscapeCode("\x1b[33m")
	FgBlue    = EscapeCode("\x1b[34m")
	FgMagenta = EscapeCode("\x1b[35m")
	FgCyan    = EscapeCode("\x1b[36m")
	FgWhite   = EscapeCode("\x1b[37m")
	FgReset   = EscapeCode("\x1b[39m")

	BgBlack   = EscapeCode("\x1b[40m")
	BgRed     = EscapeCode("\x1b[41m")
	BgGreen   = EscapeCode("\x1b[42m")
	BgYellow  = EscapeCode("\x1b[43m")
	BgBlue    = EscapeCode("\x1b[44m")
	BgMagenta = EscapeCode("\x1b[45m")
	BgCyan    = EscapeCode("\x1b[46m")
	BgWhite   = EscapeCode("\x1b[47m")
	BgReset   = EscapeCode("\x1b[49m")
)
View Source
var Enabled = false

Functions

This section is empty.

Types

type EscapeCode added in v0.2.0

type EscapeCode string

func Bg256Color added in v0.2.0

func Bg256Color(c uint8) EscapeCode

func BgRGB added in v0.2.0

func BgRGB(r, g, b uint8) EscapeCode

func Fg256Color added in v0.2.0

func Fg256Color(c uint8) EscapeCode

func FgRGB added in v0.2.0

func FgRGB(r, g, b uint8) EscapeCode

func (EscapeCode) String added in v0.2.0

func (ec EscapeCode) String() string

Jump to

Keyboard shortcuts

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