overlay

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLines

func GetLines(s string) (lines []string, widest int)

GetLines Split a string into lines, additionally returning the size of the widest line.

func PlaceOverlay

func PlaceOverlay(
	x, y int,
	fg, bg string,
	shadow bool, opts ...WhitespaceOption,
) string

PlaceOverlay places fg on top of bg.

func PlaceOverlayWithPosition

func PlaceOverlayWithPosition(
	position OverlayPosition,
	fullWidth, fullHeight int,
	fg, bg string,
	shadow bool, opts ...WhitespaceOption,
) string

func PlaceOverlayWithPositionAndPadding

func PlaceOverlayWithPositionAndPadding(
	position OverlayPosition,
	fullWidth, fullHeight int,
	horizontalPadding, verticalPadding int,
	fg, bg string,
	shadow bool, opts ...WhitespaceOption,
) string

PlaceOverlayWithPosition places fg on top of bg with overlay position

Types

type OverlayPosition

type OverlayPosition string
const (
	OverlayPositionCenter      OverlayPosition = "center"
	OverlayPositionTopRight    OverlayPosition = "topRight"
	OverlayPositionTopLeft     OverlayPosition = "topLeft"
	OverlayPositionBottomRight OverlayPosition = "bottomright"
)

type WhitespaceOption

type WhitespaceOption func(*whitespace)

WhitespaceOption sets a styling rule for rendering whitespace.

func WithWhitespaceChars

func WithWhitespaceChars(s string) WhitespaceOption

WithWhitespaceChars sets the characters to be rendered in the whitespace.

Jump to

Keyboard shortcuts

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