brand

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package brand is the Hostinger terminal look of hcdn-connector's quickview. Spans are written as given: make outside text (file names, API errors) safe before it gets here.

Index

Constants

View Source
const (
	Reset = "\x1b[0m"
	Bold  = "\x1b[1m"
)

Variables

View Source
var (
	Purple  = RGB{0x67, 0x3d, 0xe6}
	Pink    = RGB{0xa8, 0x55, 0xf7}
	Lilac   = RGB{0x8c, 0x85, 0xff}
	Gray    = RGB{0x6b, 0x72, 0x80}
	Green   = RGB{0x1f, 0xe0, 0xa8}
	Amber   = RGB{0xff, 0xb0, 0x20}
	Red     = RGB{0xfc, 0x51, 0x85}
	SoftRed = RGB{0xd9, 0x5f, 0x6e}
	White   = RGB{0xff, 0xff, 0xff}
)

Functions

func AgentShell added in v1.9.0

func AgentShell() bool

AgentShell reports a shell started by an AI agent, which may still have a pseudo-terminal: a redrawn view there only costs it tokens.

func Logo(w io.Writer, p Palette, cols int, subtitle string)

Logo falls back to a one-line wordmark when cols is too narrow.

func Spinner

func Spinner(n int) string

func Supported

func Supported(f *os.File) bool

Supported also turns on escape sequences in a Windows console that can take them.

func TextWidth

func TextWidth(s string) int

func Width

func Width(f *os.File) int

Types

type Line

type Line []Span

func Box

func Box(title, text, frame, textStyle string, cols int) []Line

Box falls back to one plain row when cols is too narrow for the frame.

func (Line) Render

func (l Line) Render(cols int) string

Render cuts l to cols columns so it never wraps.

type Palette

type Palette struct{ Truecolor bool }

Palette falls back to the 256 xterm colours when the terminal does not announce 24-bit colour.

func NewPalette

func NewPalette() Palette

func (Palette) Bg

func (p Palette) Bg(c RGB) string

func (Palette) Fg

func (p Palette) Fg(c RGB) string

type RGB

type RGB struct{ R, G, B uint8 }

func Mix

func Mix(a, b RGB, t float64) RGB

type Span

type Span struct {
	Text  string
	Style string
}

Span keeps text apart from its escapes, so a line's width is known.

func S

func S(text, style string) Span

Jump to

Keyboard shortcuts

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