theme

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package theme provides a semantic color theme for terminal output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelColor

type LabelColor struct {
	Name  string
	Color string // Hex color without #
}

LabelColor represents a label with its GitHub color.

type Theme

type Theme struct {

	// Semantic colors
	Accent  termcolor.Color // Primary accent (cyan)
	Success termcolor.Color // Success/added (green)
	Error   termcolor.Color // Error/removed (red)
	Warning termcolor.Color // Warning (orange)
	Muted   termcolor.Color // Muted/secondary text (gray)
	Dim     termcolor.Color // Very dim text

	// Change indicators
	Added   termcolor.Color // Added items (green)
	Removed termcolor.Color // Removed items (red)
	Changed termcolor.Color // Changed items (yellow/orange)

	// Issue-specific colors
	IssueNumber termcolor.Color // Issue number (#123)
	IssueTitle  termcolor.Color // Issue title
	LabelText   termcolor.Color // Text on label backgrounds (calculated per-label)

	// Field names/values
	FieldName  termcolor.Color // Field names (title:, labels:, etc.)
	OldValue   termcolor.Color // Old values in diffs
	NewValue   termcolor.Color // New values in diffs
	Arrow      termcolor.Color // Arrow in diffs (->)
	StatusChar termcolor.Color // Status characters (A, U, M, etc.)
	// contains filtered or unexported fields
}

Theme provides semantic colors for terminal output.

func Default

func Default() *Theme

Default returns the default theme with nice colors.

func (*Theme) AccentText

func (t *Theme) AccentText(text string) string

AccentText returns text in accent color.

func (*Theme) Bold

func (t *Theme) Bold(text string) string

Bold returns bold text.

func (*Theme) DimText

func (t *Theme) DimText(text string) string

Dim returns dim text.

func (*Theme) ErrorText

func (t *Theme) ErrorText(text string) string

ErrorText returns text in error color.

func (*Theme) Fg

func (t *Theme) Fg(c termcolor.Color, text string) string

Fg returns text with the given foreground color.

func (*Theme) FormatChange

func (t *Theme) FormatChange(field, oldVal, newVal string) string

FormatChange formats a change line like " title: "old" -> "new"". Old values are shown with strikethrough, new values with underline.

func (*Theme) FormatIssueHeader

func (t *Theme) FormatIssueHeader(status, number, title string) string

FormatIssueHeader formats an issue header line like "U Issue #123: Title".

func (*Theme) FormatLabel

func (t *Theme) FormatLabel(name, hexColor string) string

FormatLabel formats a label with its background color from GitHub. The text color is automatically calculated for readability.

func (*Theme) FormatLabelChange

func (t *Theme) FormatLabelChange(added, removed []LabelColor) string

FormatLabelChange formats label changes with +/- indicators.

func (*Theme) FormatLabelList

func (t *Theme) FormatLabelList(labels []LabelColor) string

FormatLabelList formats a list of labels with colors.

func (*Theme) FormatStatus

func (t *Theme) FormatStatus(status string) string

FormatStatus formats a status character (A, U, M, D, R).

func (*Theme) MutedText

func (t *Theme) MutedText(text string) string

MutedText returns text in muted color.

func (*Theme) Strikethrough

func (t *Theme) Strikethrough(text string) string

Strikethrough returns text with strikethrough styling.

func (*Theme) Styler

func (t *Theme) Styler() *termcolor.Styler

Styler returns the underlying termcolor Styler.

func (*Theme) SuccessText

func (t *Theme) SuccessText(text string) string

SuccessText returns text in success color.

func (*Theme) Underline

func (t *Theme) Underline(text string) string

Underline returns text with underline styling.

func (*Theme) WarningText

func (t *Theme) WarningText(text string) string

WarningText returns text in warning color.

Jump to

Keyboard shortcuts

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