all repos — bibel @ 995003ab506a7dc2fc1a212da5b5d9bd2cdd58ad

Unnamed repository; edit this file 'description' to name the repository.

refactor: replace adaptive hex colours with ANSI terminal colours

- Remove light/dark background detection and adaptive colour logic
  - Delete `HasDarkBackground()` check and `lightDark()` helper in
    `tui/model.go`
  - Remove dependency on terminal colour detection from `lipgloss`
- Replace hex colour config with fixed ANSI colour codes
  - Delete `border_colour`, `header_colour`, `text_colour`,
    `quit_colour` from `internal/config.go` and
    `configs/config.example.toml`
  - Remove default and viper bindings for all four colour fields
  - Update `SaveConfig()` and `LoadConfig()` accordingly
- Rewrite `createStyles()` in `internal/tui/model.go` to use ANSI
  colours
  - Border and quit message: ANSI bright black (`8`)
  - Header: ANSI green (`2`)
  - Text: default terminal colour (empty string)
  - Verse numbers: ANSI bright black (`8`)
  - Easter error message: ANSI red (`1`)
  - Easter bar filled: bright white (`15`) on green (`2`)
  - Easter bar empty: bright black (`8`) on black (`0`)
- Update `README.md`
  - Change "Adaptive Styling" to "ANSI Colours"
  - Remove documentation for removed colour configuration options
  - Update Easter progress bar styling description
- Add `CHANGELOG.md` entry for version 0.10.0 with all changes and
  removals
Maxwell Jensen 85795372+maxwelljens@users.noreply.github.com
Sat, 18 Apr 2026 14:08:15 +0200
commit

995003ab506a7dc2fc1a212da5b5d9bd2cdd58ad

parent

4d989dbd3374640c4671c3a77cc588c4fb078be0

5 files changed, 38 insertions(+), 88 deletions(-)

jump to
M CHANGELOG.mdCHANGELOG.md

@@ -8,6 +8,21 @@ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] +## [0.10.0] - 2026-04-18 + +### Changed + +- **ANSI colour**: Changed from hex colour codes to ANSI terminal colours +- Removed light/dark mode detection and adaptive colour logic +- Changed "Adaptive Styling" to "ANSI Colours" in `README` + +### Removed + +- Removed `border_colour`, `header_colour`, `text_colour`, `quit_colour` from +TOML configuration +- `HasDarkBackground()` check and `lightDark()` helper function +- All `#RRGGBB` colour codes (replaced with ANSI codes) + ## [0.9.0] - 2026-04-17 ### Added
M README.mdREADME.md

@@ -12,7 +12,7 @@ - **Date-Based Progression**: Automatically calculates position based on day of

year (1 January = Matthew 1:1-12) - **Smart Sizing**: Default snippet size is 12 verses, extends to end of chapter if less than 12 verses remain -- **Adaptive Styling**: Terminal-adaptive colours and borders using `lipgloss` +- **ANSI Colours: Uses ANSI terminal colours set by terminal emulator - **Interactive Controls**: Press `q` to quit (MOTD-like behaviour) - **Yearly Cycle**: Progresses through all four Gospels each year, restarting on 1 January

@@ -94,11 +94,6 @@ - **show_quit_message**: Whether to show "Press q to quit..." message (default:

true) - **border_style**: Box border style: "rounded", "double", "single", or "hidden" (default: "rounded") -- **border_colour**: Box border colour (hex or named colour, empty for -adaptive) -- **header_colour**: Header text colour (empty for adaptive) -- **text_colour**: Bible text colour (empty for adaptive) -- **quit_colour**: Quit message colour (empty for adaptive) #### Formatter Settings (`[formatter]` section) - **use_colours**: Whether to use ANSI colours in formatted output (default:

@@ -193,7 +188,7 @@

### Progress Bar Features - **Visual Progress**: Filled segments (█) showing annual cycle percentage between consecutive Easters - **Time Display**: Shows exact days, hours, and minutes until next Easter -- **Styling**: Uses `lipgloss` with green-filled segments and adaptive terminal colours +- **Styling: Uses `lipgloss` with ANSI-coloured segments - **Configuration**: Easter type configurable via `easter_type` field in TOML configuration ### Easter Calculations
M configs/config.example.tomlconfigs/config.example.toml

@@ -18,13 +18,6 @@ show_quit_message = true

# Box border style: "rounded", "double", "single", or "hidden" border_style = "rounded" - - # Colours for TUI elements (empty = adaptive to terminal) - # Use hex colours like "#FF0000" or named colours like "red" - border_colour = "" # Box border colour - header_colour = "" # Header text colour - text_colour = "" # Bible text colour - quit_colour = "" # Quit message colour [formatter] # Whether to use ANSI colours in formatted output mode
M internal/config.gointernal/config.go

@@ -55,18 +55,6 @@ ShowQuitMessage bool `toml:"show_quit_message" mapstructure:"show_quit_message"`

// Box border style: "rounded", "double", "single", "hidden" BorderStyle string `toml:"border_style" mapstructure:"border_style"` - - // Box border colour (default: adaptive to terminal) - BorderColour string `toml:"border_colour" mapstructure:"border_colour"` - - // Header colour (default: adaptive to terminal) - HeaderColour string `toml:"header_colour" mapstructure:"header_colour"` - - // Text colour (default: adaptive to terminal) - TextColour string `toml:"text_colour" mapstructure:"text_colour"` - - // Quit message colour (default: adaptive to terminal) - QuitColour string `toml:"quit_colour" mapstructure:"quit_colour"` } `toml:"tui" mapstructure:"tui"` // Formatter settings

@@ -105,10 +93,6 @@ }

cfg.TUI.ShowQuitMessage = true cfg.TUI.BorderStyle = "rounded" - cfg.TUI.BorderColour = "" // Empty means adaptive - cfg.TUI.HeaderColour = "" // Empty means adaptive - cfg.TUI.TextColour = "" // Empty means adaptive - cfg.TUI.QuitColour = "" // Empty means adaptive cfg.Formatter.UseColours = true cfg.Formatter.HeaderFormat = "{book} {chapter}\nw. {first_verse}-{second_verse}"

@@ -142,10 +126,6 @@ viper.SetDefault("bible_path", defaultCfg.BiblePath)

viper.SetDefault("easter_type", defaultCfg.EasterType) viper.SetDefault("tui.show_quit_message", defaultCfg.TUI.ShowQuitMessage) viper.SetDefault("tui.border_style", defaultCfg.TUI.BorderStyle) - viper.SetDefault("tui.border_colour", defaultCfg.TUI.BorderColour) - viper.SetDefault("tui.header_colour", defaultCfg.TUI.HeaderColour) - viper.SetDefault("tui.text_colour", defaultCfg.TUI.TextColour) - viper.SetDefault("tui.quit_colour", defaultCfg.TUI.QuitColour) viper.SetDefault("formatter.use_colours", defaultCfg.Formatter.UseColours) viper.SetDefault("formatter.header_format", defaultCfg.Formatter.HeaderFormat) viper.SetDefault("formatter.numbered", defaultCfg.Formatter.Numbered)

@@ -219,10 +199,6 @@ viper.Set("bible_path", cfg.BiblePath)

viper.Set("easter_type", cfg.EasterType) viper.Set("tui.show_quit_message", cfg.TUI.ShowQuitMessage) viper.Set("tui.border_style", cfg.TUI.BorderStyle) - viper.Set("tui.border_colour", cfg.TUI.BorderColour) - viper.Set("tui.header_colour", cfg.TUI.HeaderColour) - viper.Set("tui.text_colour", cfg.TUI.TextColour) - viper.Set("tui.quit_colour", cfg.TUI.QuitColour) viper.Set("formatter.use_colours", cfg.Formatter.UseColours) viper.Set("formatter.header_format", cfg.Formatter.HeaderFormat) viper.Set("formatter.numbered", cfg.Formatter.Numbered)
M internal/tui/model.gointernal/tui/model.go

@@ -51,47 +51,18 @@ }

// createStyles creates the lipgloss styles based on configuration func createStyles(config *bible.Config) *Styles { - // Detect if terminal has dark background - hasDarkBG := lipgloss.HasDarkBackground() - - // Helper function for light/dark colors - lightDark := func(light, dark lipgloss.TerminalColor) lipgloss.TerminalColor { - if hasDarkBG { - return dark - } - return light - } - - // Get colours from config, or use adaptive defaults - var borderColour, headerColour, textColour, quitColour lipgloss.TerminalColor - - // Border colour - if config.TUI.BorderColour != "" { - borderColour = lipgloss.Color(config.TUI.BorderColour) - } else { - borderColour = lightDark(lipgloss.Color("#666666"), lipgloss.Color("#999999")) - } - - // Header colour (matching formatter's green) - if config.TUI.HeaderColour != "" { - headerColour = lipgloss.Color(config.TUI.HeaderColour) - } else { - headerColour = lightDark(lipgloss.Color("#00AA00"), lipgloss.Color("#00FF00")) - } - - // Text colour - if config.TUI.TextColour != "" { - textColour = lipgloss.Color(config.TUI.TextColour) - } else { - textColour = lightDark(lipgloss.Color("#000000"), lipgloss.Color("#FFFFFF")) - } - - // Quit message colour - if config.TUI.QuitColour != "" { - quitColour = lipgloss.Color(config.TUI.QuitColour) - } else { - quitColour = lightDark(lipgloss.Color("#555555"), lipgloss.Color("#AAAAAA")) - } + // Use ANSI colours (set by terminal emulator) + // Border colour - bright black (gray) + borderColour := lipgloss.Color("8") // ANSI bright black (gray) + + // Header colour - green (matching formatter's green) + headerColour := lipgloss.Color("2") // ANSI green + + // Text colour - default terminal text colour + textColour := lipgloss.Color("") // Default terminal colour + + // Quit message colour - bright black (gray) + quitColour := lipgloss.Color("8") // ANSI bright black (gray) // Create border style based on config var border lipgloss.Border

@@ -124,7 +95,7 @@ content: lipgloss.NewStyle().

Foreground(textColour), numberStyle: lipgloss.NewStyle(). - Foreground(lightDark(lipgloss.Color("#444444"), lipgloss.Color("#AAAAAA"))). + Foreground(lipgloss.Color("8")). // ANSI bright black (gray) Bold(false), quitMessage: lipgloss.NewStyle().

@@ -250,7 +221,7 @@ progress, err := m.easterProg.GetEasterProgressPercentage()

if err != nil { // If we can't calculate Easter, show error message errorStyle := lipgloss.NewStyle(). - Foreground(lipgloss.Color("#FF4444")). + Foreground(lipgloss.Color("1")). // ANSI red Italic(true) return errorStyle.Width(width - 6).Render("Unable to calculate Easter date") }

@@ -272,14 +243,14 @@ // Calculate filled width

filledWidth := max(min(int(float64(barWidth)*progress), barWidth), 0) emptyWidth := barWidth - filledWidth - // Define styles + // Define styles using ANSI colours filledStyle := lipgloss.NewStyle(). - Foreground(lipgloss.Color("#FFFFFF")). - Background(lipgloss.Color("#00AA00")) + Foreground(lipgloss.Color("15")). // Bright white + Background(lipgloss.Color("2")) // Green emptyStyle := lipgloss.NewStyle(). - Foreground(lipgloss.Color("#888888")). - Background(lipgloss.Color("#222222")) + Foreground(lipgloss.Color("8")). // Bright black (gray) + Background(lipgloss.Color("0")) // Black // Create bar segments filledBar := filledStyle.Render(strings.Repeat("█", filledWidth))

@@ -289,14 +260,14 @@

// Add percentage text percentage := fmt.Sprintf("%.1f%%", progress*100) percentageStyle := lipgloss.NewStyle(). - Foreground(lipgloss.Color("#AAAAAA")). + Foreground(lipgloss.Color("8")). // ANSI bright black (gray) Bold(true) percentageText := percentageStyle.Render(percentage) // Combine time text, bar, and percentage timeStyle := lipgloss.NewStyle(). - Foreground(lipgloss.Color("#CCCCCC")) + Foreground(lipgloss.Color("7")) // ANSI white (light gray) timeText := timeStyle.Width(barWidth - len(percentage) - 2).Render(timeStr)