1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-07 14:29:17 +00:00

Uniform color specifications

This commit is contained in:
Tw93
2025-12-02 14:45:48 +08:00
parent 8d29a35fc9
commit 8cdf583d85
14 changed files with 40 additions and 36 deletions

View File

@@ -223,12 +223,14 @@ var skipExtensions = map[string]bool{
var spinnerFrames = []string{"|", "/", "-", "\\", "|", "/", "-", "\\"}
const (
colorPurple = "\033[0;35m"
colorGray = "\033[0;90m"
colorRed = "\033[0;31m"
colorYellow = "\033[1;33m"
colorGreen = "\033[0;32m"
colorCyan = "\033[0;36m"
colorReset = "\033[0m"
colorBold = "\033[1m"
colorPurple = "\033[0;35m"
colorPurpleBold = "\033[1;35m"
colorGray = "\033[0;90m"
colorRed = "\033[0;31m"
colorYellow = "\033[0;33m"
colorGreen = "\033[0;32m"
colorBlue = "\033[0;34m"
colorCyan = "\033[0;36m"
colorReset = "\033[0m"
colorBold = "\033[1m"
)

View File

@@ -115,7 +115,7 @@ func coloredProgressBar(value, max int64, percent float64) string {
} else if percent >= 20 {
barColor = colorYellow
} else if percent >= 5 {
barColor = colorCyan
barColor = colorBlue
} else {
barColor = colorGreen
}

View File

@@ -794,7 +794,7 @@ func (m model) View() string {
fmt.Fprintln(&b)
if m.inOverviewMode() {
fmt.Fprintf(&b, "%sAnalyze Disk%s\n", colorPurple, colorReset)
fmt.Fprintf(&b, "%sAnalyze Disk%s\n", colorPurpleBold, colorReset)
if m.overviewScanning {
// Check if we're in initial scan (all entries are pending)
allPending := true
@@ -834,7 +834,7 @@ func (m model) View() string {
}
}
} else {
fmt.Fprintf(&b, "%sAnalyze Disk%s %s%s%s", colorPurple, colorReset, colorGray, displayPath(m.path), colorReset)
fmt.Fprintf(&b, "%sAnalyze Disk%s %s%s%s", colorPurpleBold, colorReset, colorGray, displayPath(m.path), colorReset)
if !m.scanning {
fmt.Fprintf(&b, " | Total: %s", humanizeBytes(m.totalSize))
}
@@ -962,7 +962,7 @@ func (m model) View() string {
case percent >= 20:
sizeColor = colorYellow
case percent >= 5:
sizeColor = colorCyan
sizeColor = colorBlue
default:
sizeColor = colorGray
}
@@ -1050,7 +1050,7 @@ func (m model) View() string {
} else if percent >= 20 {
sizeColor = colorYellow
} else if percent >= 5 {
sizeColor = colorCyan
sizeColor = colorBlue
} else {
sizeColor = colorGray
}

View File

@@ -10,12 +10,12 @@ import (
)
var (
titleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#5FD7FF")).Bold(true)
subtleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#6C6C6C"))
titleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#C79FD7")).Bold(true)
subtleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#9E9E9E"))
warnStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFD75F"))
dangerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF5F5F")).Bold(true)
dangerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF6B6B")).Bold(true)
okStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#87D787"))
lineStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#4A4A4A"))
lineStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#5A5A5A"))
)
const (
@@ -134,11 +134,11 @@ func renderHeader(m MetricsSnapshot, errMsg string, animFrame int, termWidth int
func getScoreStyle(score int) lipgloss.Style {
if score >= 90 {
// Excellent - Green
return lipgloss.NewStyle().Foreground(lipgloss.Color("#87D787")).Bold(true)
// Excellent - Bright Green
return lipgloss.NewStyle().Foreground(lipgloss.Color("#87FF87")).Bold(true)
} else if score >= 75 {
// Good - Light Green
return lipgloss.NewStyle().Foreground(lipgloss.Color("#AFD787")).Bold(true)
// Good - Green
return lipgloss.NewStyle().Foreground(lipgloss.Color("#87D787")).Bold(true)
} else if score >= 60 {
// Fair - Yellow
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FFD75F")).Bold(true)
@@ -147,7 +147,7 @@ func getScoreStyle(score int) lipgloss.Style {
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FFAF5F")).Bold(true)
} else {
// Critical - Red
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FF5F5F")).Bold(true)
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FF6B6B")).Bold(true)
}
}