feat(theme): add catppuccin themes with transparency and 256-color support
Add a theme package providing all four catppuccin flavors (mocha, frappe, macchiato, latte) mapped to the xterm-256 palette. Themes are selected with -theme or the CTOP_THEME environment variable; -i inverts the flavor. Background slots use the terminal's native color for transparency (opt out with -solid / CTOP_SOLID), and termbox is switched to Output256 so colors render correctly. Replace hardcoded colors in the compact and single views with ctheme portrait slots.
This commit is contained in:
@@ -3,6 +3,7 @@ package menu
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/bcicen/ctop/theme"
|
||||
ui "github.com/gizak/termui"
|
||||
)
|
||||
|
||||
@@ -105,7 +106,7 @@ func (m *Menu) Buffer() ui.Buffer {
|
||||
for _, ch := range item.Text() {
|
||||
// invert bg/fg colors on currently selected row
|
||||
if m.Selectable && n == m.cursorPos {
|
||||
cell = ui.Cell{Ch: ch, Fg: ui.ColorBlack, Bg: m.TextFgColor}
|
||||
cell = ui.Cell{Ch: ch, Fg: theme.Attr("crust"), Bg: m.TextFgColor}
|
||||
} else {
|
||||
cell = ui.Cell{Ch: ch, Fg: m.TextFgColor, Bg: m.TextBgColor}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user