ui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ui provides shared styling and UI components for subnetCalc.

Index

Constants

This section is empty.

Variables

View Source
var (
	// HeaderStyle is used for table headers.
	HeaderStyle = lipgloss.NewStyle().
				Bold(true).
				Background(lipgloss.Color("39")).
				Foreground(lipgloss.Color("15")).
				Padding(0, 1)

	// SelectedStyle highlights the selected row in the TUI.
	SelectedStyle = lipgloss.NewStyle().
					Background(lipgloss.Color("57")).
					Foreground(lipgloss.Color("15")).
					Bold(true)

	// NormalStyle is the default style for table rows.
	NormalStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("252"))

	// BorderStyle defines the table border appearance.
	BorderStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(lipgloss.Color("39"))

	// TitleStyle is used for section titles.
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("39")).
				MarginTop(1)

	// StatusStyle displays status messages.
	StatusStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("82")).
				Bold(true)
)

Shared lipgloss styles for table rendering across formatter and TUI packages.

View Source
var PrefixColors = []lipgloss.Color{
	lipgloss.Color("212"),
	lipgloss.Color("141"),
	lipgloss.Color("75"),
	lipgloss.Color("81"),
	lipgloss.Color("120"),
	lipgloss.Color("228"),
	lipgloss.Color("216"),
	lipgloss.Color("210"),
	lipgloss.Color("177"),
	lipgloss.Color("69"),
	lipgloss.Color("87"),
	lipgloss.Color("156"),
	lipgloss.Color("222"),
	lipgloss.Color("213"),
	lipgloss.Color("105"),
	lipgloss.Color("192"),
}

PrefixColors is a color palette for different prefix lengths in the TUI.

Functions

func GetColorForPrefix

func GetColorForPrefix(bits, initialPrefix int) lipgloss.Color

GetColorForPrefix returns a color based on the prefix length. It cycles through PrefixColors based on the depth from the initial prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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