paint

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 1 module, 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 paint makes a rendered frame opaque.

Rex shows the terminal underneath a floating layer through every cell left on the default background. lipgloss leaves such cells wherever a styled span ends (its SGR reset clears the background), in padding, and in the rest of a line, so a frame built from perfectly themed components still has holes. Fill closes them after the fact; Holes counts what is left.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(frame string, bg color.Color, profile colorprofile.Profile) string

Fill returns frame with bg set on every cell that has no background of its own. Cells that already carry a background keep it, so wells and accent bars survive. The result is rectangular: a short line is padded to the widest line's width with bg-coloured cells.

On a 16-colour (or poorer) profile Fill returns frame unchanged: bg would be rounded to the nearest of 16 colours, usually black, which makes a worse slab than the see-through cells it replaces. This matches forge's solidCard.

func Holes

func Holes(frame string, w, h int) int

Holes counts the cells of frame, laid out on a w×h canvas, that have no background. It counts on the canvas and never on a re-parsed string: Canvas.Render trims trailing spaces, so a right-padded line would read as shorter than it is. Cells outside the frame but inside w×h count as holes, which is the point when asserting a frame covers its whole layer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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