aboutsummaryrefslogtreecommitdiff
path: root/internal/tui/styles.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 21:03:32 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 21:03:32 +0200
commita7e3ad33070dee77fd7a7796a1e6da9a762440e5 (patch)
tree2f03f1d12b36aebd1f3a9ce259d0921a35a00098 /internal/tui/styles.go
parentffa4676a34851d667acbf8a460321ff93310b7ba (diff)
downloadlectio-a7e3ad33070dee77fd7a7796a1e6da9a762440e5.tar.gz
lectio-a7e3ad33070dee77fd7a7796a1e6da9a762440e5.zip
tui: respect terminal colours (ANSI palette + attributes); reverse-video bars for legible header/footer
Diffstat (limited to 'internal/tui/styles.go')
-rw-r--r--internal/tui/styles.go52
1 files changed, 24 insertions, 28 deletions
diff --git a/internal/tui/styles.go b/internal/tui/styles.go
index 94b591e..eb4f50a 100644
--- a/internal/tui/styles.go
+++ b/internal/tui/styles.go
@@ -2,43 +2,39 @@ package tui
import "github.com/charmbracelet/lipgloss"
-// Color roles for the reader. lipgloss.AdaptiveColor picks the Light or Dark
-// value based on the terminal's detected background, and the default
-// renderer's color profile already honors NO_COLOR (muesli/termenv's
-// EnvColorProfile falls back to Ascii, so styled text degrades to plain
-// text automatically -- no extra handling needed here).
-var (
- accentColor = lipgloss.AdaptiveColor{Light: "#8839ef", Dark: "#cba6f7"} // heading
- dimColor = lipgloss.AdaptiveColor{Light: "#6c6f85", Dark: "#a6adc8"} // citation
- mutedColor = lipgloss.AdaptiveColor{Light: "#9ca0b0", Dark: "#6c7086"} // verse numbers
- textColor = lipgloss.AdaptiveColor{Light: "#4c4f69", Dark: "#cdd6f4"} // verse text (default)
- barColor = lipgloss.AdaptiveColor{Light: "#eff1f5", Dark: "#313244"} // header/footer background
- barTextColor = lipgloss.AdaptiveColor{Light: "#4c4f69", Dark: "#cdd6f4"}
- errColor = lipgloss.AdaptiveColor{Light: "#d20f39", Dark: "#f38ba8"}
-)
-
+// Color roles for the reader. These use the terminal's own ANSI palette
+// (colours 0-15) and text attributes rather than fixed hex values, so the
+// reader respects whatever colour scheme the terminal is configured with
+// instead of forcing one. Verse body text takes the terminal's default
+// foreground (most legible). The header and footer bars use reverse video
+// (the terminal's fg/bg swapped) so they stay readable on any theme -- no
+// faint text on a fixed grey bar. NO_COLOR still degrades everything to
+// plain text automatically (termenv's profile falls back to Ascii).
var (
// headingStyle renders a reading section's heading (e.g. "Ewangelia").
- headingStyle = lipgloss.NewStyle().Bold(true).Foreground(accentColor)
+ headingStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("4")) // ANSI blue
- // citationStyle renders a section's subtitle/citation line.
- citationStyle = lipgloss.NewStyle().Faint(true).Foreground(dimColor)
+ // citationStyle renders a section's subtitle/citation line -- dimmed.
+ citationStyle = lipgloss.NewStyle().Faint(true)
- // verseNumStyle renders a bible verse's "chapter:verse" prefix.
- verseNumStyle = lipgloss.NewStyle().Foreground(mutedColor)
+ // verseNumStyle renders a bible verse's "chapter:verse" prefix -- dimmed.
+ verseNumStyle = lipgloss.NewStyle().Faint(true)
- // verseTextStyle renders verse/paragraph body text.
- verseTextStyle = lipgloss.NewStyle().Foreground(textColor)
+ // verseTextStyle renders verse/paragraph body text in the terminal's
+ // default foreground colour.
+ verseTextStyle = lipgloss.NewStyle()
// refrainStyle renders a responsorial psalm's repeated refrain.
- refrainStyle = lipgloss.NewStyle().Italic(true).Foreground(textColor)
+ refrainStyle = lipgloss.NewStyle().Italic(true)
- // headerStyle renders the top bar (date + active version).
- headerStyle = lipgloss.NewStyle().Bold(true).Foreground(barTextColor).Background(barColor).Padding(0, 1)
+ // headerStyle renders the top bar (date + active version) as a reverse-
+ // video bar so it reads on any terminal theme.
+ headerStyle = lipgloss.NewStyle().Bold(true).Reverse(true).Padding(0, 1)
- // footerStyle renders the bottom keybar.
- footerStyle = lipgloss.NewStyle().Faint(true).Foreground(barTextColor).Background(barColor).Padding(0, 1)
+ // footerStyle renders the bottom keybar as a reverse-video bar (legible,
+ // not faint-on-grey).
+ footerStyle = lipgloss.NewStyle().Reverse(true).Padding(0, 1)
// errStyle renders the error line.
- errStyle = lipgloss.NewStyle().Bold(true).Foreground(errColor)
+ errStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("1")) // ANSI red
)