Documentation
¶
Index ¶
Constants ¶
const ( RoleTitle = termtheme.RoleTitle RolePrimary = termtheme.RolePrimary RoleSecondary = termtheme.RoleSecondary RoleAccent = termtheme.RoleAccent RoleMuted = termtheme.RoleMuted RoleSubtle = termtheme.RoleSubtle RoleForeground = termtheme.RoleForeground RoleSelected = termtheme.RoleSelected RoleSelectedBar = termtheme.RoleSelectedBar RoleBorder = termtheme.RoleBorder RoleSuccess = termtheme.RoleSuccess RoleWarning = termtheme.RoleWarning RoleDanger = termtheme.RoleDanger RoleInfo = termtheme.RoleInfo RoleSearch = termtheme.RoleSearch RolePill = termtheme.RolePill )
Variables ¶
var ( ParseThemeConfig = termtheme.ParseThemeConfig ParseStyleSpec = termtheme.ParseStyleSpec Apply = termtheme.Apply VisibleWidth = termtheme.VisibleWidth Strip = termtheme.Strip Sanitize = termtheme.Sanitize PadRight = termtheme.PadRight Truncate = termtheme.Truncate TruncateWith = termtheme.TruncateWith )
Engine functions re-exported from termtheme. Sharing these is what makes a theme written by any sibling app parse and render identically here.
var ImportTheme = termtheme.Unmarshal
ImportTheme parses a portable .theme file into a config plus its metadata.
Functions ¶
func BuiltinThemeNames ¶
func BuiltinThemeNames() []string
BuiltinThemeNames lists the selectable base palettes in display order. It is the single source of truth the theme editor cycles through, so adding a builtin here surfaces it in the UI automatically.
func ExportTheme ¶
func ExportTheme(cfg ThemeConfig, base Theme, app, version string) []byte
ExportTheme serializes the resolved theme to the portable .theme format: a versioned header plus a full inline dump of every role, so the file is self-contained and interchanges with any sibling app. base is the builtin palette the config was authored against (passage Theme and termtheme.Theme share an identical layout, so the conversion is free).
Types ¶
type Theme ¶
Theme is passage's concrete palette: a role->SGR-code map plus a NoColor switch. It is in-memory render state (never serialized — ThemeConfig is), so it stays local to passage along with its builtin palettes; the interchange surface lives in termtheme (see shim.go).
func BuiltinTheme ¶
func ResolveTheme ¶
func ResolveTheme(opts ThemeOptions) (Theme, error)
func TerminalTheme ¶
func TerminalTheme() Theme
func VividTheme ¶
func VividTheme() Theme
func (Theme) Normalized ¶
func (Theme) WithNoColor ¶
type ThemeConfig ¶
type ThemeConfig = termtheme.ThemeConfig
ThemeConfig is the parsed theme file (base name + per-role overrides).