fix(ui): set hex color for ghost text instead of hardcoded ANSI bright-black (#49)
fix #48 Now ghost text use `#4B4A4C` color instead of hard-coded ANSI color
This commit is contained in:
@@ -138,6 +138,7 @@ type Theme struct {
|
|||||||
DescSel lipgloss.Color
|
DescSel lipgloss.Color
|
||||||
SelBg lipgloss.Color
|
SelBg lipgloss.Color
|
||||||
ScrollInfo lipgloss.Color
|
ScrollInfo lipgloss.Color
|
||||||
|
GhostText lipgloss.Color
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentTheme = Theme{
|
var currentTheme = Theme{
|
||||||
@@ -151,6 +152,7 @@ var currentTheme = Theme{
|
|||||||
DescSel: lipgloss.Color("#edecee"),
|
DescSel: lipgloss.Color("#edecee"),
|
||||||
SelBg: lipgloss.Color("#3d375e"),
|
SelBg: lipgloss.Color("#3d375e"),
|
||||||
ScrollInfo: lipgloss.Color("#a277ff"),
|
ScrollInfo: lipgloss.Color("#a277ff"),
|
||||||
|
GhostText: lipgloss.Color("#4B4A4C"),
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetTheme(t Theme) {
|
func SetTheme(t Theme) {
|
||||||
@@ -485,9 +487,8 @@ func (o *Overlay) RenderGhostText(buffer string, userNavigated bool, cursorAtEnd
|
|||||||
|
|
||||||
s.WriteString("\0337")
|
s.WriteString("\0337")
|
||||||
if ghostText != "" {
|
if ghostText != "" {
|
||||||
s.WriteString("\033[90m")
|
styled := lipgloss.NewStyle().Foreground(currentTheme.GhostText).Render(ghostText)
|
||||||
s.WriteString(ghostText)
|
s.WriteString(styled)
|
||||||
s.WriteString("\033[0m")
|
|
||||||
}
|
}
|
||||||
if padLen > 0 {
|
if padLen > 0 {
|
||||||
s.WriteString(strings.Repeat(" ", padLen))
|
s.WriteString(strings.Repeat(" ", padLen))
|
||||||
|
|||||||
Reference in New Issue
Block a user