Documentation
¶
Index ¶
- Constants
- type ColorScheme
- type GrayscaleColorScheme
- func (GrayscaleColorScheme) Addition(s string) string
- func (GrayscaleColorScheme) Breaking(s string) string
- func (GrayscaleColorScheme) LocationInfo(s string) string
- func (GrayscaleColorScheme) Modification(s string) string
- func (GrayscaleColorScheme) Removal(s string) string
- func (GrayscaleColorScheme) Statistics(s string) string
- func (GrayscaleColorScheme) TreeBranch(s string) string
- type NoColorScheme
- func (NoColorScheme) Addition(s string) string
- func (NoColorScheme) Breaking(s string) string
- func (NoColorScheme) LocationInfo(s string) string
- func (NoColorScheme) Modification(s string) string
- func (NoColorScheme) Removal(s string) string
- func (NoColorScheme) Statistics(s string) string
- func (NoColorScheme) TreeBranch(s string) string
- type TerminalColorScheme
- func (TerminalColorScheme) Addition(s string) string
- func (TerminalColorScheme) Breaking(s string) string
- func (TerminalColorScheme) LocationInfo(s string) string
- func (TerminalColorScheme) Modification(s string) string
- func (TerminalColorScheme) Removal(s string) string
- func (TerminalColorScheme) Statistics(s string) string
- func (TerminalColorScheme) TreeBranch(s string) string
Constants ¶
const ( // reset clears all formatting Reset = "\033[0m" // green is used for additions (ANSI 256-color code 46) Green = "\033[38;5;46m" // yellow is used for modifications (ANSI 256-color code 220) Yellow = "\033[38;5;220m" // red is used for removals (ANSI 256-color code 196) Red = "\033[38;5;196m" // redBold is used for breaking changes - bold red for emphasis RedBold = "\033[1;38;5;196m" // grey is used for tree structure and location info (ANSI 256-color code 240) // this is a "sub 2" level grey (~60% opacity equivalent) for subtle dimming Grey = "\033[38;5;240m" )
ansi 256-color escape codes for terminal output. these codes match vacuum's existing color palette for consistency across pb33f tools.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorScheme ¶
type ColorScheme interface {
// Addition colorizes text representing added elements
Addition(text string) string
// Modification colorizes text representing modified elements
Modification(text string) string
// Removal colorizes text representing removed elements
Removal(text string) string
// Breaking colorizes text representing breaking changes
Breaking(text string) string
// TreeBranch colorizes tree structure characters (├──, └──, │, etc.)
TreeBranch(text string) string
// LocationInfo colorizes location information like (line:col)
LocationInfo(text string) string
// Statistics colorizes statistics text like (N changes, M breaking)
Statistics(text string) string
}
ColorScheme defines how to colorize different elements of tree output. implementations can provide terminal colors, grayscale dimming, or no colors.
type GrayscaleColorScheme ¶
type GrayscaleColorScheme struct{}
GrayscaleColorScheme dims decorative elements only, without semantic colors. this is the default scheme when colors are enabled. use case: cleaner output that highlights content without color distraction. tree branches, location info, and statistics are dimmed; change symbols remain unchanged.
func (GrayscaleColorScheme) Addition ¶
func (GrayscaleColorScheme) Addition(s string) string
func (GrayscaleColorScheme) Breaking ¶
func (GrayscaleColorScheme) Breaking(s string) string
func (GrayscaleColorScheme) LocationInfo ¶
func (GrayscaleColorScheme) LocationInfo(s string) string
func (GrayscaleColorScheme) Modification ¶
func (GrayscaleColorScheme) Modification(s string) string
func (GrayscaleColorScheme) Removal ¶
func (GrayscaleColorScheme) Removal(s string) string
func (GrayscaleColorScheme) Statistics ¶
func (GrayscaleColorScheme) Statistics(s string) string
func (GrayscaleColorScheme) TreeBranch ¶
func (GrayscaleColorScheme) TreeBranch(s string) string
type NoColorScheme ¶
type NoColorScheme struct{}
NoColorScheme returns text unchanged. use this for piped output, non-TTY contexts, or when --no-style is specified.
func (NoColorScheme) Addition ¶
func (NoColorScheme) Addition(s string) string
func (NoColorScheme) Breaking ¶
func (NoColorScheme) Breaking(s string) string
func (NoColorScheme) LocationInfo ¶
func (NoColorScheme) LocationInfo(s string) string
func (NoColorScheme) Modification ¶
func (NoColorScheme) Modification(s string) string
func (NoColorScheme) Removal ¶
func (NoColorScheme) Removal(s string) string
func (NoColorScheme) Statistics ¶
func (NoColorScheme) Statistics(s string) string
func (NoColorScheme) TreeBranch ¶
func (NoColorScheme) TreeBranch(s string) string
type TerminalColorScheme ¶
type TerminalColorScheme struct{}
TerminalColorScheme applies full semantic colors for terminal display. this is an opt-in scheme for colorful output with semantic meaning. additions are green, modifications are yellow, removals are red, breaking changes are bold red. tree branches, location info, and statistics are dimmed grey.
func (TerminalColorScheme) Addition ¶
func (TerminalColorScheme) Addition(s string) string
func (TerminalColorScheme) Breaking ¶
func (TerminalColorScheme) Breaking(s string) string
func (TerminalColorScheme) LocationInfo ¶
func (TerminalColorScheme) LocationInfo(s string) string
func (TerminalColorScheme) Modification ¶
func (TerminalColorScheme) Modification(s string) string
func (TerminalColorScheme) Removal ¶
func (TerminalColorScheme) Removal(s string) string
func (TerminalColorScheme) Statistics ¶
func (TerminalColorScheme) Statistics(s string) string
func (TerminalColorScheme) TreeBranch ¶
func (TerminalColorScheme) TreeBranch(s string) string