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:
@@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/bcicen/ctop/cwidgets"
|
||||
"github.com/bcicen/ctop/theme"
|
||||
ui "github.com/gizak/termui"
|
||||
)
|
||||
|
||||
@@ -26,13 +27,13 @@ func NewIO() *IO {
|
||||
read.Title = "READ"
|
||||
read.Height = 1
|
||||
read.Data = io.readHist.Data
|
||||
read.LineColor = ui.ColorGreen
|
||||
read.LineColor = theme.Attr("io.read")
|
||||
|
||||
write := ui.NewSparkline()
|
||||
write.Title = "WRITE"
|
||||
write.Height = 1
|
||||
write.Data = io.writeHist.Data
|
||||
write.LineColor = ui.ColorYellow
|
||||
write.LineColor = theme.Attr("io.write")
|
||||
|
||||
io.Lines = []ui.Sparkline{read, write}
|
||||
return io
|
||||
|
||||
Reference in New Issue
Block a user