mark

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 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.

func Logo(w, h int, color bool, c Color) []string

Logo is the mark as half-block pixel art, two pixels per character cell, h pixels tall (even): strokes in the terminal's own text color, the dot in the brand's orange. Without colors the dot is drawn like a stroke.

func Pixels added in v0.1.4

func Pixels(w, h int) [][]Ink

Pixels draws the mark as crisp pixel art in a w×h grid: each stroke of the W two pixels wide on every row, the loop a one-pixel ring and the dot a 2×2 block in the first V, placed from the SVG's geometry (the view box fitted, centred).

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 Ink added in v0.1.4

type Ink int

Ink is what a pixel of the mark is: nothing, a stroke (the W and its loop) or the dot.

const (
	Blank Ink = iota
	Stroke
	Dot
)

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