mark

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 3 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 mark draws the Waniis mark (the W, its loop and the dot) turning in 3D, in Braille characters, for a terminal's status line. The mark's lines are points in space: each frame turns them about the vertical axis, projects them with a little perspective and lights the nearest Braille dot, so the mark reads as a thin wire shape spinning like a coin.

Index

Constants

View Source
const (
	Cols = 6
	Rows = 2
)

Size is the spinner's size in cells: two lines of six.

View Source
const Cycle = 26

Cycle is how many frames one turn takes; the mark rests near face on for part of it.

Variables

This section is empty.

Functions

func AngleAt

func AngleAt(i int) float64

AngleAt is the mark's angle at frame i: a smooth half-second-ish turn, then a rest.

func Frame

func Frame(angle float64, cols, rows int) (cells string, facing float64)

Frame is the mark turned by angle (radians) in cols×rows Braille cells. facing is cos(angle): 1 face on, 0 edge on, below 0 the back.

Types

type Color

type Color int

Color says how many colors the terminal shows.

const (
	Color16 Color = iota
	Color256
	ColorTrue
)

func DetectColor

func DetectColor(getenv func(string) string) Color

DetectColor reads the terminal's color support from the environment.

type Spinner

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

Spinner draws the turning mark for an animation frame: Rows lines of Cols cells, colored. Frames are computed once and reused.

func NewSpinner

func NewSpinner(c Color) *Spinner

NewSpinner computes every frame for a terminal with the given colors.

func (*Spinner) Lines

func (sp *Spinner) Lines(i int) [Rows]string

Lines is frame i, one string per line.

Jump to

Keyboard shortcuts

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