theme

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog added in v0.4.0

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

func LoadCatalog added in v0.4.0

func LoadCatalog(dirs []string) (Catalog, error)

func (Catalog) All added in v0.4.0

func (c Catalog) All() []Definition

func (Catalog) Get added in v0.4.0

func (c Catalog) Get(key string) (Definition, bool)

func (Catalog) Keys added in v0.4.0

func (c Catalog) Keys() []string

type ColorsSpec added in v0.4.0

type ColorsSpec struct {
	PaneBorderFocusFile     *string `json:"pane_border_focus_file" toml:"pane_border_focus_file"`
	PaneBorderFocusRequests *string `json:"pane_border_focus_requests" toml:"pane_border_focus_requests"`
	PaneActiveForeground    *string `json:"pane_active_foreground" toml:"pane_active_foreground"`
}

type CommandSegmentSpec added in v0.4.0

type CommandSegmentSpec struct {
	Background *string `json:"background" toml:"background"`
	Border     *string `json:"border" toml:"border"`
	Key        *string `json:"key" toml:"key"`
	Text       *string `json:"text" toml:"text"`
}

type CommandSegmentStyle

type CommandSegmentStyle struct {
	Background lipgloss.Color
	Border     lipgloss.Color
	Key        lipgloss.Color
	Text       lipgloss.Color
}

type Definition added in v0.4.0

type Definition struct {
	Key         string
	DisplayName string
	Metadata    Metadata
	Theme       Theme
	Source      Source
	Format      Format
	Path        string
}

type EditorMetadataPalette added in v0.1.7

type EditorMetadataPalette struct {
	CommentMarker    lipgloss.Color
	DirectiveDefault lipgloss.Color
	Value            lipgloss.Color
	SettingKey       lipgloss.Color
	SettingValue     lipgloss.Color
	RequestLine      lipgloss.Color
	RequestSeparator lipgloss.Color
	DirectiveColors  map[string]lipgloss.Color
}

type EditorMetadataSpec added in v0.4.0

type EditorMetadataSpec struct {
	CommentMarker    *string           `json:"comment_marker" toml:"comment_marker"`
	DirectiveDefault *string           `json:"directive_default" toml:"directive_default"`
	Value            *string           `json:"value" toml:"value"`
	SettingKey       *string           `json:"setting_key" toml:"setting_key"`
	SettingValue     *string           `json:"setting_value" toml:"setting_value"`
	RequestLine      *string           `json:"request_line" toml:"request_line"`
	RequestSeparator *string           `json:"request_separator" toml:"request_separator"`
	DirectiveColors  map[string]string `json:"directive_colors" toml:"directive_colors"`
}

type Format added in v0.4.0

type Format string
const (
	FormatBuiltin Format = "builtin"
	FormatJSON    Format = "json"
	FormatTOML    Format = "toml"
)

type HeaderSegmentSpec added in v0.4.0

type HeaderSegmentSpec struct {
	Background *string `json:"background" toml:"background"`
	Border     *string `json:"border" toml:"border"`
	Foreground *string `json:"foreground" toml:"foreground"`
	Accent     *string `json:"accent" toml:"accent"`
}

type HeaderSegmentStyle

type HeaderSegmentStyle struct {
	Background lipgloss.Color
	Border     lipgloss.Color
	Foreground lipgloss.Color
	Accent     lipgloss.Color
}

type Metadata added in v0.4.0

type Metadata struct {
	Name        string   `json:"name" toml:"name"`
	Description string   `json:"description" toml:"description"`
	Author      string   `json:"author" toml:"author"`
	Version     string   `json:"version" toml:"version"`
	Tags        []string `json:"tags" toml:"tags"`
}

type Source added in v0.4.0

type Source string
const (
	SourceBuiltin Source = "builtin"
	SourceUser    Source = "user"
)

type StyleSpec added in v0.4.0

type StyleSpec struct {
	Foreground       *string `json:"foreground" toml:"foreground"`
	Background       *string `json:"background" toml:"background"`
	BorderColor      *string `json:"border_color" toml:"border_color"`
	BorderBackground *string `json:"border_background" toml:"border_background"`
	BorderStyle      *string `json:"border_style" toml:"border_style"`
	Bold             *bool   `json:"bold" toml:"bold"`
	Italic           *bool   `json:"italic" toml:"italic"`
	Underline        *bool   `json:"underline" toml:"underline"`
	Faint            *bool   `json:"faint" toml:"faint"`
	Strikethrough    *bool   `json:"strikethrough" toml:"strikethrough"`
	Align            *string `json:"align" toml:"align"`
}

type StylesSpec added in v0.4.0

type StylesSpec struct {
	BrowserBorder                 *StyleSpec `json:"browser_border" toml:"browser_border"`
	EditorBorder                  *StyleSpec `json:"editor_border" toml:"editor_border"`
	ResponseBorder                *StyleSpec `json:"response_border" toml:"response_border"`
	AppFrame                      *StyleSpec `json:"app_frame" toml:"app_frame"`
	Header                        *StyleSpec `json:"header" toml:"header"`
	HeaderTitle                   *StyleSpec `json:"header_title" toml:"header_title"`
	HeaderValue                   *StyleSpec `json:"header_value" toml:"header_value"`
	HeaderSeparator               *StyleSpec `json:"header_separator" toml:"header_separator"`
	StatusBar                     *StyleSpec `json:"status_bar" toml:"status_bar"`
	StatusBarKey                  *StyleSpec `json:"status_bar_key" toml:"status_bar_key"`
	StatusBarValue                *StyleSpec `json:"status_bar_value" toml:"status_bar_value"`
	CommandBar                    *StyleSpec `json:"command_bar" toml:"command_bar"`
	CommandBarHint                *StyleSpec `json:"command_bar_hint" toml:"command_bar_hint"`
	ResponseSearchHighlight       *StyleSpec `json:"response_search_highlight" toml:"response_search_highlight"`
	ResponseSearchHighlightActive *StyleSpec `json:"response_search_highlight_active" toml:"response_search_highlight_active"`
	Tabs                          *StyleSpec `json:"tabs" toml:"tabs"`
	TabActive                     *StyleSpec `json:"tab_active" toml:"tab_active"`
	TabInactive                   *StyleSpec `json:"tab_inactive" toml:"tab_inactive"`
	Notification                  *StyleSpec `json:"notification" toml:"notification"`
	Error                         *StyleSpec `json:"error" toml:"error"`
	Success                       *StyleSpec `json:"success" toml:"success"`
	HeaderBrand                   *StyleSpec `json:"header_brand" toml:"header_brand"`
	CommandDivider                *StyleSpec `json:"command_divider" toml:"command_divider"`
	PaneTitle                     *StyleSpec `json:"pane_title" toml:"pane_title"`
	PaneTitleFile                 *StyleSpec `json:"pane_title_file" toml:"pane_title_file"`
	PaneTitleRequests             *StyleSpec `json:"pane_title_requests" toml:"pane_title_requests"`
	PaneDivider                   *StyleSpec `json:"pane_divider" toml:"pane_divider"`
	EditorHintBox                 *StyleSpec `json:"editor_hint_box" toml:"editor_hint_box"`
	EditorHintItem                *StyleSpec `json:"editor_hint_item" toml:"editor_hint_item"`
	EditorHintSelected            *StyleSpec `json:"editor_hint_selected" toml:"editor_hint_selected"`
	EditorHintAnnotation          *StyleSpec `json:"editor_hint_annotation" toml:"editor_hint_annotation"`
	ListItemTitle                 *StyleSpec `json:"list_item_title" toml:"list_item_title"`
	ListItemDescription           *StyleSpec `json:"list_item_description" toml:"list_item_description"`
	ListItemSelectedTitle         *StyleSpec `json:"list_item_selected_title" toml:"list_item_selected_title"`
	ListItemSelectedDescription   *StyleSpec `json:"list_item_selected_description" toml:"list_item_selected_description"`
	ListItemDimmedTitle           *StyleSpec `json:"list_item_dimmed_title" toml:"list_item_dimmed_title"`
	ListItemDimmedDescription     *StyleSpec `json:"list_item_dimmed_description" toml:"list_item_dimmed_description"`
	ListItemFilterMatch           *StyleSpec `json:"list_item_filter_match" toml:"list_item_filter_match"`
	ResponseContent               *StyleSpec `json:"response_content" toml:"response_content"`
	ResponseContentRaw            *StyleSpec `json:"response_content_raw" toml:"response_content_raw"`
	ResponseContentHeaders        *StyleSpec `json:"response_content_headers" toml:"response_content_headers"`
}

type Theme

type Theme struct {
	BrowserBorder                 lipgloss.Style
	EditorBorder                  lipgloss.Style
	ResponseBorder                lipgloss.Style
	AppFrame                      lipgloss.Style
	Header                        lipgloss.Style
	HeaderTitle                   lipgloss.Style
	HeaderValue                   lipgloss.Style
	HeaderSeparator               lipgloss.Style
	StatusBar                     lipgloss.Style
	StatusBarKey                  lipgloss.Style
	StatusBarValue                lipgloss.Style
	CommandBar                    lipgloss.Style
	CommandBarHint                lipgloss.Style
	ResponseSearchHighlight       lipgloss.Style
	ResponseSearchHighlightActive lipgloss.Style
	Tabs                          lipgloss.Style
	TabActive                     lipgloss.Style
	TabInactive                   lipgloss.Style
	Notification                  lipgloss.Style
	Error                         lipgloss.Style
	Success                       lipgloss.Style
	HeaderBrand                   lipgloss.Style
	HeaderSegments                []HeaderSegmentStyle
	CommandSegments               []CommandSegmentStyle
	CommandDivider                lipgloss.Style
	PaneTitle                     lipgloss.Style
	PaneTitleFile                 lipgloss.Style
	PaneTitleRequests             lipgloss.Style
	PaneDivider                   lipgloss.Style
	PaneBorderFocusFile           lipgloss.Color
	PaneBorderFocusRequests       lipgloss.Color
	PaneActiveForeground          lipgloss.Color
	EditorMetadata                EditorMetadataPalette
	EditorHintBox                 lipgloss.Style
	EditorHintItem                lipgloss.Style
	EditorHintSelected            lipgloss.Style
	EditorHintAnnotation          lipgloss.Style
	ListItemTitle                 lipgloss.Style
	ListItemDescription           lipgloss.Style
	ListItemSelectedTitle         lipgloss.Style
	ListItemSelectedDescription   lipgloss.Style
	ListItemDimmedTitle           lipgloss.Style
	ListItemDimmedDescription     lipgloss.Style
	ListItemFilterMatch           lipgloss.Style
	ResponseContent               lipgloss.Style
	ResponseContentRaw            lipgloss.Style
	ResponseContentHeaders        lipgloss.Style
}

func ApplySpec added in v0.4.0

func ApplySpec(base Theme, spec ThemeSpec) (Theme, error)

func DefaultTheme

func DefaultTheme() Theme

func (Theme) CommandSegment

func (t Theme) CommandSegment(idx int) CommandSegmentStyle

func (Theme) HeaderSegment

func (t Theme) HeaderSegment(idx int) HeaderSegmentStyle

type ThemeSpec added in v0.4.0

type ThemeSpec struct {
	Metadata        *Metadata            `json:"metadata" toml:"metadata"`
	Styles          StylesSpec           `json:"styles" toml:"styles"`
	Colors          ColorsSpec           `json:"colors" toml:"colors"`
	HeaderSegments  []HeaderSegmentSpec  `json:"header_segments" toml:"header_segments"`
	CommandSegments []CommandSegmentSpec `json:"command_segments" toml:"command_segments"`
	EditorMetadata  *EditorMetadataSpec  `json:"editor_metadata" toml:"editor_metadata"`
}

Jump to

Keyboard shortcuts

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