Documentation
¶
Overview ¶
Package theme provides a semantic color theme for terminal output.
Index ¶
- type LabelColor
- type Theme
- func (t *Theme) AccentText(text string) string
- func (t *Theme) Bold(text string) string
- func (t *Theme) DimText(text string) string
- func (t *Theme) ErrorText(text string) string
- func (t *Theme) Fg(c termcolor.Color, text string) string
- func (t *Theme) FormatChange(field, oldVal, newVal string) string
- func (t *Theme) FormatIssueHeader(status, number, title string) string
- func (t *Theme) FormatLabel(name, hexColor string) string
- func (t *Theme) FormatLabelChange(added, removed []LabelColor) string
- func (t *Theme) FormatLabelList(labels []LabelColor) string
- func (t *Theme) FormatStatus(status string) string
- func (t *Theme) MutedText(text string) string
- func (t *Theme) Strikethrough(text string) string
- func (t *Theme) Styler() *termcolor.Styler
- func (t *Theme) SuccessText(text string) string
- func (t *Theme) Underline(text string) string
- func (t *Theme) WarningText(text string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LabelColor ¶
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 (*Theme) AccentText ¶
AccentText returns text in accent color.
func (*Theme) FormatChange ¶
FormatChange formats a change line like " title: "old" -> "new"". Old values are shown with strikethrough, new values with underline.
func (*Theme) FormatIssueHeader ¶
FormatIssueHeader formats an issue header line like "U Issue #123: Title".
func (*Theme) FormatLabel ¶
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 ¶
FormatStatus formats a status character (A, U, M, D, R).
func (*Theme) Strikethrough ¶
Strikethrough returns text with strikethrough styling.
func (*Theme) SuccessText ¶
SuccessText returns text in success color.
func (*Theme) WarningText ¶
WarningText returns text in warning color.