color

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Style

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

Style holds ANSI formatting attributes for terminal output.

func New

func New() Style

New returns a new empty Style.

func (Style) Bold

func (s Style) Bold() Style

Bold enables bold text.

func (Style) Foreground

func (s Style) Foreground(hex string) Style

Foreground sets the foreground color from a hex string like "#f05c07".

func (Style) Italic

func (s Style) Italic() Style

Italic enables italic text.

func (Style) Render

func (s Style) Render(text string) string

Render wraps text with the configured ANSI escape sequences. If stdout is not a TTY (e.g. piped or redirected), codes are suppressed.

Jump to

Keyboard shortcuts

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