theme

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 18 Imported by: ? 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

Colors and chrome shared by every icebath surface

Index

Constants

View Source
const DefaultName = "blackwall"

DefaultName is the theme a session starts in, Light standing in for it on a light terminal

Variables

This section is empty.

Functions

func Answered

func Answered(reply string) (light, ok bool)

Whether the color a terminal answered of its background or its foreground, OSC 11 or OSC 10, is light: the answer whole, as the terminal sent it with its end, BEL or ST, or its body alone. false for an answer that names no color

func Black

func Black(c color.Color) bool

Whether the color is black whole, as a terminal with a see-through profile answers whatever shows behind it

func ColorAnswered

func ColorAnswered(reply string) (color.Color, bool)

The color a terminal answered of its background or its foreground, the answer whole or its body. false for one that names no color

func FromColorFGBG

func FromColorFGBG(value string) (light, ok bool)

Whether the background a terminal's COLORFGBG names is light, alpha's reading: its last field the number of a color of the 16, 7 and 15 light, any other dark. false for a value that names none

func Hex

func Hex(v uint32) color.Color

Opaque color from a 24 bit RGB value

func IcebathBorder

func IcebathBorder() lipgloss.Border

Single line frame with square corners, the icebath border

func Lit

func Lit(c color.Color) (light, ok bool)

Whether a color of background is light, alpha's way: its luma at least 0.6; false for none

func Mix

func Mix(a, b color.Color, t float64) color.Color

Color t of the way from a to b, treating a nil side as the other side

func Names

func Names() []string

Names of the styles of the kit, sorted

func ParseColor

func ParseColor(spec string) (color.Color, bool)

A color as an X server and the terminals write it in their answers: rgb: with 1 to 4 hex digits to each part, rgba: likewise with its alpha, rgbi: with each part a number from 0 to 1, and # with 3, 6, 9 or 12 hex digits, the same count for each part. false for anything else, a part of no hex digit, of more than four, or out of its range included

func RGB

func RGB(value string) (color.Color, bool)

Color of #rrggbb, for the banner art of a style

func Ratio

func Ratio(a, b color.Color) float64

Contrast ratio between two colors as the eye takes it, from 1 for the same lightness to 21 for black on white

func Ring

func Ring(n int, stops ...color.Color) []color.Color

Produces n colors that run through the stops and return to the first so they tile seamlessly

func Shade

func Shade(c color.Color, amount float64) color.Color

Darkens c toward black by amount

func SystemLight

func SystemLight(ctx context.Context) (light, ok bool)

Whether the desktop asks programs for light colors: the color scheme the desktop portal of freedesktop.org says, as GNOME, KDE and the others answer it (1 dark, 2 light, 0 no preference), otherwise GNOME's own color-scheme, otherwise whether the name of its GTK theme says dark; false where none of them says

Types

type Brand

type Brand struct {
	// Line over the banner of a new session, and line the app writes as it quits. Empty for none
	Welcome, Goodbye string

The words a style greets and parts with and its banner art, as alpha's skins have them

type Glyphs

type Glyphs struct {
	// Mark of the product beside its name
	Brand    string
	Session  string
	Trace    string
	Agent    string
	Approval string
	Metrics  string
	Findings string
	Jobs     string
	Mission  string
	Sessions string
	Settings string
	Config   string
	Palette  string
	Terminal string
	Card     string
	Profiles string
	Models   string
	Rules    string
	Hooks    string
	MCP      string
	Tools    string
	Keys     string
	Ext      string
	Flow     string
	Read     string
	Write    string
	Edit     string
	Glob     string
	Grep     string
	Shell    string
	Output   string
	Kill     string
	Fetch    string
	Spawn    string
	Record   string
	Plan     string
	Server   string
	Tool     string
	Steer    string
	Thinking string
	Compact  string
	Hook     string
	Note     string
	Error    string
	Flag     string
	Ask      string
	Child    string
	Attach   string
	Cursor   string
	Marked   string
	Live     string
	Hollow   string
	Check    string
	Skip     string
	Todo     string
	Done     string
	Active   string
	Bullet   string
	Mask     string
	Fork     string
	// Arrow of the send button, the voice input mark and the spoken replies mark
	Send  string
	Voice string
	Speak string
	Sep   string
	// Ellipsis marks text left out of a long output, always three periods
	Ellipsis string
	Close    string
	Prompt   string
	Notch    string
	Grip     string
	Back     string
	Forward  string
	Info     string
	Success  string
	Warn     string
	Fail     string
	Search   string
	// Bell is the notification button's mark on the bar, and Muted replaces it while pop-up notifications are silenced. Each is one code
	// point, because a terminal may draw a combining mark beside its letter.
	Bell      string
	Muted     string
	None      string
	Rule      string
	Dashed    string
	Bar       string
	Fill      string
	Slide     string
	Thumb     string
	SwitchOn  string
	SwitchOff string
	Caret     string
	Up        string
	Down      string
	Track     string
	Heavy     string
	Tick      string
	HeavyTick string
	Hit       string
	Full      string
	Empty     string
	// Eight levels of a bar graph from lowest to highest
	Ramp []rune
	// Frames of the working spinner
	Spinner []string
	// One cell symbols of bare navigation chords such as pgup, text labels stand in for chords missing here
	Chords map[string]string
}

Glyphs is every mark the interface draws, swapped as one set so the full surface keeps one look.

func ASCIIGlyphs

func ASCIIGlyphs() Glyphs

ASCIIGlyphs returns the same marks in printable ASCII, for terminals without box drawing or symbol fonts.

func IcebathGlyphs

func IcebathGlyphs() Glyphs

IcebathGlyphs returns the icebath set: frost, signal and hazard marks in single cells.

type ID

type ID struct {
	Name   string
	Serial uint64
}

What tells one style from another: its name and the serial it was handed in under, so what is drawn with a style is drawn again once the style of that name is another

type Set

type Set struct {
	// contains filtered or unexported fields
}

Styles one surface draws with: those of the kit, and those it was handed by each source, such as the styles folder of a profile or its extensions. Each surface keeps its own, so what one is handed never reaches another

func NewSet

func NewSet() *Set

func (*Set) All

func (s *Set) All() []Theme

Every style, a name once, sorted by name

func (*Set) Named

func (s *Set) Named(name string) (Theme, bool)

Style by name, one of the kit first, then that of the first source that handed one of the name. false for an unknown name

func (*Set) Names

func (s *Set) Names() []string

Names of every style, sorted

func (*Set) Replace

func (s *Set) Replace(source string, styles []Theme)

Puts the styles a source hands in place of those it handed before, one named like a style of the kit left out. Each style handed in takes a serial of its own, so one handed in again is another style to whatever keeps what it drew

type Theme

type Theme struct {
	Name string
	// What the style looks like, in a few words
	About       string
	Bg          color.Color
	Surface     color.Color
	Text        color.Color
	TextDim     color.Color
	Steel       color.Color
	SteelBright color.Color
	Ghost       color.Color
	Accent      color.Color
	Ice         color.Color
	Pulse       color.Color
	Alive       color.Color
	Alarm       color.Color
	Ring        []color.Color
	Border      lipgloss.Border
	Glyphs      Glyphs
	Plain       bool
	// Sixteen ANSI colors programs in a terminal paint with, a nil entry leaving the host terminal color
	Terminal [16]color.Color
	// What a style file brings of its own beside its colors and marks, nothing for a style of the kit
	Brand Brand
	// Serial a source handed the style in under, zero for a style of the kit, so a style handed in again under its name is told apart
	Serial uint64
}

Palette and border set that a deck paints with

func All

func All() []Theme

Every style of the kit, sorted by name

func Blackwall

func Blackwall() Theme

Near black palette of icebath.app

func Contrast

func Contrast() Theme

Black and white palette with saturated signal colors and a thick border for low vision

func Cyberpunk

func Cyberpunk() Theme

Neon green on black, the matrix terminal

func Dracula

func Dracula() Theme

The Dracula palette, purple and pink on slate

func Light

func Light() Theme

Paper palette for bright rooms with the same red accent

func Named

func Named(name string) (Theme, bool)

Style of the kit by name, false for an unknown name

func Parse

func Parse(fallback string, data []byte) (Theme, error)

Theme of a style file: the colors it sets over those of the style of the kit it names as its base, the default style when it names none. Its name is the file's own, otherwise the one given

func Plain

func Plain() Theme

Sixteen color palette with an ASCII border for terminals without true color or box drawing

func Taro

func Taro() Theme

Deep indigo palette with amber, cyan and magenta

func (Theme) ID

func (t Theme) ID() ID

Identity of the style, for keeping what is drawn with it

func (Theme) On

func (t Theme) On(bg color.Color) color.Color

Text color that reads on the background: that of the style, or its backdrop where the background is as light as the text

func (Theme) Over

func (t Theme) Over(bg, want color.Color) color.Color

The wanted color where it reads on the background, otherwise the text color that does

func (Theme) Part

func (t Theme) Part(name string) (color.Color, bool)

Color of a part of the style by the name a style file sets it by, such as accent or text_dim. false for a name of no part

Jump to

Keyboard shortcuts

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