diff --git a/examples/spinner/main.go b/examples/spinner/main.go index 93d8b73..47bf5a2 100644 --- a/examples/spinner/main.go +++ b/examples/spinner/main.go @@ -10,11 +10,8 @@ import ( "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" - "github.com/muesli/termenv" ) -var color = termenv.ColorProfile().Color - type errMsg error type model struct { @@ -62,8 +59,7 @@ func (m model) View() string { if m.err != nil { return m.err.Error() } - s := termenv.String(m.spinner.View()).Foreground(color("205")).String() - str := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", s) + str := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", m.spinner.View()) if m.quitting { return str + "\n" } diff --git a/examples/tui-daemon-combo/main.go b/examples/tui-daemon-combo/main.go index 18af402..4b22c82 100644 --- a/examples/tui-daemon-combo/main.go +++ b/examples/tui-daemon-combo/main.go @@ -11,14 +11,12 @@ import ( "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" "github.com/mattn/go-isatty" "github.com/muesli/reflow/indent" - "github.com/muesli/termenv" ) -var ( - color = termenv.ColorProfile().Color -) +var helpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Render func main() { rand.Seed(time.Now().UTC().UnixNano()) @@ -67,8 +65,11 @@ type model struct { func newModel() model { const showLastResults = 5 + sp := spinner.NewModel() + sp.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("206")) + return model{ - spinner: spinner.NewModel(), + spinner: sp, results: make([]result, showLastResults), } } @@ -103,8 +104,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (m model) View() string { s := "\n" + - termenv.String(m.spinner.View()).Foreground(color("206")).String() + - " Doing some work...\n\n" + m.spinner.View() + " Doing some work...\n\n" for _, res := range m.results { if res.duration == 0 { @@ -114,7 +114,7 @@ func (m model) View() string { } } - s += termenv.String("\nPress any key to exit\n").Foreground(color("240")).String() + s += helpStyle("\nPress any key to exit\n") if m.quitting { s += "\n"