theme

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BG

func BG(color, text string) string

func BGANSI

func BGANSI(color string) string

func BashModeBorderColor

func BashModeBorderColor() func(string) string

func Bold

func Bold(value string) string

func ColorModeGlobal

func ColorModeGlobal() string

func EditorTheme

func EditorTheme() tui.EditorTheme

func FG

func FG(color, text string) string

func FGANSI

func FGANSI(color string) string

func GetAllThemes

func GetAllThemes() []extensions.ThemeInfo

func Highlight

func Highlight(code, language string, theme *Theme) []string

func Inverse

func Inverse(value string) string

func Italic

func Italic(value string) string

func LanguageFromPath

func LanguageFromPath(path string) string

func MarkdownTheme

func MarkdownTheme() tui.MarkdownTheme

func ResolveSetting

func ResolveSetting(setting string, terminal TerminalTheme) (string, bool)

func SetCurrent

func SetCurrent(t *Theme)

func SetTheme

func SetTheme(name string) error

func Strikethrough

func Strikethrough(value string) string

func ThinkingBorderColor

func ThinkingBorderColor(level agent.ThinkingLevel) func(string) string

func Underline

func Underline(value string) string

Types

type AutoSetting

type AutoSetting struct {
	Light string
	Dark  string
}

func ParseAutoSetting

func ParseAutoSetting(setting string) (AutoSetting, bool)

type Collision

type Collision struct {
	ResourceType string
	Name         string
	WinnerPath   string
	LoserPath    string
}

type ColorMode

type ColorMode string
const (
	TrueColor ColorMode = "truecolor"
	Color256  ColorMode = "256color"
)

func DetectColorMode

func DetectColorMode(environment map[string]string) ColorMode

type ColorValue

type ColorValue struct {
	String *string
	Index  *int
}

func (*ColorValue) UnmarshalJSON

func (value *ColorValue) UnmarshalJSON(data []byte) error

type Controller

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

func Initialize

func Initialize(registry *Registry, setting string, terminal TerminalTheme, onChange func()) *Controller

Initialize installs the production registry/controller used by package-level render helpers and extension theme APIs.

func NewController

func NewController(registry *Registry, setting string, terminal TerminalTheme, onChange func()) *Controller

func (*Controller) Available

func (controller *Controller) Available() []string

func (*Controller) Current

func (controller *Controller) Current() *Theme

func (*Controller) Name

func (controller *Controller) Name() string

func (*Controller) Reload

func (controller *Controller) Reload() error

func (*Controller) Set

func (controller *Controller) Set(name string) error

func (*Controller) SetInstance

func (controller *Controller) SetInstance(value *Theme) error

type Detection

type Detection struct {
	Theme      TerminalTheme
	Source     string
	Detail     string
	Confidence string
}

func DetectBackground

func DetectBackground(environment map[string]string) Detection

type Diagnostic

type Diagnostic struct {
	Type      string
	Path      string
	Message   string
	Collision *Collision
}

type LoadOptions

type LoadOptions struct {
	CWD                  string
	AgentDir             string
	ProjectTrusted       bool
	NoThemes             bool
	Mode                 ColorMode
	GlobalPaths          []string
	ProjectPaths         []string
	PackagePaths         []string
	AdditionalPaths      []string
	ResourceDiscoverPath []string
}

type Registry

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

func Load

func Load(options LoadOptions) *Registry

func (*Registry) Available

func (registry *Registry) Available() []string

func (*Registry) Diagnostics

func (registry *Registry) Diagnostics() []Diagnostic

func (*Registry) Extend

func (registry *Registry) Extend(paths []string)

func (*Registry) Get

func (registry *Registry) Get(name string) (*Theme, bool)

func (*Registry) Loaded

func (registry *Registry) Loaded() []*Theme

Loaded returns non-builtin themes in first-winner path order. ResourceLoader exposes these exact objects to interactive mode, matching upstream identity.

func (*Registry) Register

func (registry *Registry) Register(theme *Theme) error

func (*Registry) ReplaceLoaded

func (registry *Registry) ReplaceLoaded(themes []*Theme) error

ReplaceLoaded atomically replaces every nonbuiltin theme with the supplied loader-owned objects. Validation happens before mutation so a bad override leaves the prior registered set intact.

type TerminalTheme

type TerminalTheme string
const (
	Dark  TerminalTheme = "dark"
	Light TerminalTheme = "light"
)

type Theme

type Theme struct {
	Name       string
	SourcePath string
	SourceInfo *extensions.SourceInfo
	// contains filtered or unexported fields
}

func Current

func Current() *Theme

func GetTheme

func GetTheme(name string) *Theme

func Parse

func Parse(label string, data []byte, mode ColorMode) (*Theme, error)

func (*Theme) Background

func (theme *Theme) Background(name, value string) string

func (*Theme) BackgroundANSI

func (theme *Theme) BackgroundANSI(name string) (string, error)

func (*Theme) ColorMode

func (theme *Theme) ColorMode() ColorMode

func (*Theme) ExportColors

func (theme *Theme) ExportColors() map[string]string

func (*Theme) Foreground

func (theme *Theme) Foreground(name, value string) string

func (*Theme) ForegroundANSI

func (theme *Theme) ForegroundANSI(name string) (string, error)

func (*Theme) Markdown

func (theme *Theme) Markdown(codeBlockIndent string) tui.MarkdownTheme

func (*Theme) ResolvedColors

func (theme *Theme) ResolvedColors(light bool) map[string]string

Jump to

Keyboard shortcuts

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