theme

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 7 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 theme holds jt's colour palettes and the lipgloss styles built on them. CLI output and the TUI both render through this package so that a `theme:` change in the config restyles everything at once.

Index

Constants

View Source
const Default = "tokyonight"

Default is the palette used when none is configured.

Variables

This section is empty.

Functions

func Fprintln

func Fprintln(w io.Writer, v ...any)

Fprintln prints styled text, downsampling colours for w.

func Names

func Names() []string

Names lists the built-in palettes.

func Table

func Table(w io.Writer, s Styles, headers []string, rows [][]string, highlight int) error

Table renders a borderless table to w. Row `highlight` (or -1 for none) is drawn in the selected style. Colours are downsampled to what w supports, so piped output stays plain.

Types

type Palette

type Palette struct {
	Name string

	Bg, Surface, Overlay color.Color // background layers: base, panels, popups
	Text, Subtle, Muted  color.Color // foreground emphasis levels
	Accent, Accent2      color.Color // primary highlight, secondary highlight
	Success, Warn, Error color.Color
	Info                 color.Color

	// Jira status categories.
	StatusTodo, StatusProgress, StatusDone color.Color
}

Palette is a set of semantic colours.

func Get

func Get(name string) Palette

Get returns the named palette, falling back to Default.

func (Palette) Status

func (p Palette) Status(categoryOrName string) color.Color

Status picks a colour for a Jira status by its category key ("new", "indeterminate", "done") or, failing that, by name.

type Styles

type Styles struct {
	Palette Palette

	Title, Header, Key, Value lipgloss.Style
	Muted, Accent, Accent2    lipgloss.Style
	Success, Warn, Error      lipgloss.Style
	Selected                  lipgloss.Style
}

Styles are the shared lipgloss styles derived from a palette.

func Active

func Active() Styles

Active returns styles for the configured `theme:`.

func New

func New(p Palette) Styles

New builds styles for a palette.

Jump to

Keyboard shortcuts

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