color

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package color provides some console output formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute string
const (
	Bold         Attribute = "1"
	Italic       Attribute = "3"
	Underline    Attribute = "4"
	ReverseVideo Attribute = "7"
	CrossedOut   Attribute = "9"
)
const (
	Black   Attribute = "30"
	Red     Attribute = "31"
	Green   Attribute = "32"
	Yellow  Attribute = "33"
	Blue    Attribute = "34"
	Magenta Attribute = "35"
	Cyan    Attribute = "36"
	White   Attribute = "37"
)
const (
	BgBlack   Attribute = "40"
	BgRed     Attribute = "41"
	BgGreen   Attribute = "42"
	BgYellow  Attribute = "43"
	BgBlue    Attribute = "44"
	BgMagenta Attribute = "45"
	BgCyan    Attribute = "46"
	BgWhite   Attribute = "47"
)

func (Attribute) Sprint

func (attr Attribute) Sprint(a ...any) string

Sprint returns a string formatted according to console properties.

func (Attribute) Sprintf

func (attr Attribute) Sprintf(format string, a ...any) string

Sprintf returns a string formatted according to console properties.

type Text

type Text struct {
	// contains filtered or unexported fields
}

func NewText

func NewText(attributes ...Attribute) *Text

NewText returns a new *Text.

func (*Text) Sprint

func (c *Text) Sprint(a ...any) string

Sprint returns a string formatted according to console properties.

func (*Text) Sprintf

func (c *Text) Sprintf(format string, a ...any) string

Sprintf returns a string formatted according to console properties.

Jump to

Keyboard shortcuts

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