util

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ansi256ToHex

func Ansi256ToHex(code int) string

Ansi256ToHex converts ANSI 256 color code to hex color.

func Ansi256ToRGB

func Ansi256ToRGB(code int) (r, g, b int)

Ansi256ToRGB converts ANSI 256 color code to RGB values.

Types

type AnsiConverter

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

AnsiConverter converts ANSI escape sequences to tview color tags.

func NewAnsiConverter

func NewAnsiConverter(enabled bool) *AnsiConverter

NewAnsiConverter creates a new ANSI converter. enabled: if false, returns text unchanged.

func (*AnsiConverter) Convert

func (c *AnsiConverter) Convert(text string) string

Convert translates ANSI escape sequences to tview color tags. Properly handles foreground, background, and bold attributes.

Jump to

Keyboard shortcuts

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