Skip to content
Myr

Support background colors in textinput

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent ee5f825 · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:textinput/textinput.go+3 added
24 unmodified lines
25 Cursor string26 BlinkSpeed time.Duration27 Placeholder string28 TextColor string29 BackgroundColor string30 PlaceholderColor string31 CursorColor string3233 // CharLimit is the maximum amount of characters this input element will
30 unmodified lines
64func (m *Model) colorText(s string) string {65 return termenv.66 String(s).67 Foreground(color(m.TextColor)).68 Background(color(m.BackgroundColor)).69 String()70}7172// colorPlaceholder colorizes a given string according to the TextColor value
1 unmodified line
74func (m *Model) colorPlaceholder(s string) string {75 return termenv.76 String(s).77 Foreground(color(m.PlaceholderColor)).78 Background(color(m.BackgroundColor)).79 String()80}8182// BlinkMsg is sent when the cursor should alternate it's blinking state
159 unmodified lines