1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-16 22:49:12 +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

Binary file not shown.

View File

@@ -34,10 +34,10 @@ main() {
# Run all checks in parallel with spinner # Run all checks in parallel with spinner
if [[ -t 1 ]]; then if [[ -t 1 ]]; then
echo -ne "${PURPLE}System Check${NC} " echo -ne "${PURPLE_BOLD}System Check${NC} "
start_inline_spinner "Running checks..." start_inline_spinner "Running checks..."
else else
echo -e "${PURPLE}System Check${NC}" echo -e "${PURPLE_BOLD}System Check${NC}"
echo "" echo ""
fi fi

View File

@@ -171,7 +171,7 @@ start_section() {
TRACK_SECTION=1 TRACK_SECTION=1
SECTION_ACTIVITY=0 SECTION_ACTIVITY=0
echo "" echo ""
echo -e "${PURPLE}${ICON_ARROW} $1${NC}" echo -e "${PURPLE_BOLD}${ICON_ARROW} $1${NC}"
} }
end_section() { end_section() {
@@ -369,7 +369,7 @@ safe_clean() {
start_cleanup() { start_cleanup() {
clear clear
printf '\n' printf '\n'
echo -e "${PURPLE}Clean Your Mac${NC}" echo -e "${PURPLE_BOLD}Clean Your Mac${NC}"
echo "" echo ""
if [[ "$DRY_RUN" != "true" && -t 0 ]]; then if [[ "$DRY_RUN" != "true" && -t 0 ]]; then

View File

@@ -17,7 +17,7 @@ source "$SCRIPT_DIR/lib/check/all.sh"
print_header() { print_header() {
printf '\n' printf '\n'
echo -e "${PURPLE}Optimize and Check${NC}" echo -e "${PURPLE_BOLD}Optimize and Check${NC}"
echo "" echo ""
} }
@@ -25,7 +25,7 @@ print_header() {
run_system_checks() { run_system_checks() {
unset AUTO_FIX_SUMMARY AUTO_FIX_DETAILS unset AUTO_FIX_SUMMARY AUTO_FIX_DETAILS
echo "" echo ""
echo -e "${PURPLE}System Check${NC}" echo -e "${PURPLE_BOLD}System Check${NC}"
echo "" echo ""
# Check updates - real-time display # Check updates - real-time display

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,8 +14,10 @@ readonly MOLE_COMMON_LOADED=1
readonly ESC=$'\033' readonly ESC=$'\033'
readonly GREEN="${ESC}[0;32m" readonly GREEN="${ESC}[0;32m"
readonly BLUE="${ESC}[0;34m" readonly BLUE="${ESC}[0;34m"
readonly YELLOW="${ESC}[1;33m" readonly CYAN="${ESC}[0;36m"
readonly YELLOW="${ESC}[0;33m"
readonly PURPLE="${ESC}[0;35m" readonly PURPLE="${ESC}[0;35m"
readonly PURPLE_BOLD="${ESC}[1;35m"
readonly RED="${ESC}[0;31m" readonly RED="${ESC}[0;31m"
readonly GRAY="${ESC}[0;90m" readonly GRAY="${ESC}[0;90m"
readonly NC="${ESC}[0m" readonly NC="${ESC}[0m"
@@ -558,7 +560,7 @@ show_menu_option() {
local selected="$3" local selected="$3"
if [[ "$selected" == "true" ]]; then if [[ "$selected" == "true" ]]; then
echo -e "${BLUE}${ICON_ARROW} $number. $text${NC}" echo -e "${CYAN}${ICON_ARROW} $number. $text${NC}"
else else
echo " $number. $text" echo " $number. $text"
fi fi
@@ -1341,7 +1343,7 @@ start_section() {
TRACK_SECTION=1 TRACK_SECTION=1
SECTION_ACTIVITY=0 SECTION_ACTIVITY=0
echo "" echo ""
echo -e "${PURPLE}${ICON_ARROW} $1${NC}" echo -e "${PURPLE_BOLD}${ICON_ARROW} $1${NC}"
} }
# End a section (show "Nothing to tidy" if no activity) # End a section (show "Nothing to tidy" if no activity)

View File

@@ -366,7 +366,7 @@ paginated_multi_select() {
[[ ${selected[real]} == true ]] && checkbox="$ICON_SOLID" [[ ${selected[real]} == true ]] && checkbox="$ICON_SOLID"
if [[ $is_current == true ]]; then if [[ $is_current == true ]]; then
printf "\r\033[2K${BLUE}${ICON_ARROW} %s %s${NC}\n" "$checkbox" "${items[real]}" >&2 printf "\r\033[2K${CYAN}${ICON_ARROW} %s %s${NC}\n" "$checkbox" "${items[real]}" >&2
else else
printf "\r\033[2K %s %s\n" "$checkbox" "${items[real]}" >&2 printf "\r\033[2K %s %s\n" "$checkbox" "${items[real]}" >&2
fi fi
@@ -387,7 +387,7 @@ paginated_multi_select() {
done done
# Header only # Header only
printf "${clear_line}${PURPLE}%s${NC} ${GRAY}%d/%d selected${NC}\n" "${title}" "$selected_count" "$total_items" >&2 printf "${clear_line}${PURPLE_BOLD}%s${NC} ${GRAY}%d/%d selected${NC}\n" "${title}" "$selected_count" "$total_items" >&2
# Visible slice # Visible slice
local visible_total=${#view_indices[@]} local visible_total=${#view_indices[@]}

View File

@@ -137,7 +137,7 @@ paginated_multi_select() {
[[ ${selected[idx]} == true ]] && checkbox="$ICON_SOLID" [[ ${selected[idx]} == true ]] && checkbox="$ICON_SOLID"
if [[ $is_current == true ]]; then if [[ $is_current == true ]]; then
printf "\r\033[2K${BLUE}${ICON_ARROW} %s %s${NC}\n" "$checkbox" "${items[idx]}" >&2 printf "\r\033[2K${CYAN}${ICON_ARROW} %s %s${NC}\n" "$checkbox" "${items[idx]}" >&2
else else
printf "\r\033[2K %s %s\n" "$checkbox" "${items[idx]}" >&2 printf "\r\033[2K %s %s\n" "$checkbox" "${items[idx]}" >&2
fi fi
@@ -161,7 +161,7 @@ paginated_multi_select() {
done done
# Header # Header
printf "${clear_line}${PURPLE}%s${NC} ${GRAY}%d/%d selected${NC}\n" "${title}" "$selected_count" "$total_items" >&2 printf "${clear_line}${PURPLE_BOLD}%s${NC} ${GRAY}%d/%d selected${NC}\n" "${title}" "$selected_count" "$total_items" >&2
if [[ $total_items -eq 0 ]]; then if [[ $total_items -eq 0 ]]; then
printf "${clear_line}${GRAY}No items available${NC}\n" >&2 printf "${clear_line}${GRAY}No items available${NC}\n" >&2

View File

@@ -156,7 +156,7 @@ batch_uninstall_applications() {
# Display detailed file list for each app before confirmation # Display detailed file list for each app before confirmation
echo "" echo ""
echo -e "${PURPLE}Files to be removed:${NC}" echo -e "${PURPLE_BOLD}Files to be removed:${NC}"
echo "" echo ""
for detail in "${app_details[@]}"; do for detail in "${app_details[@]}"; do
IFS='|' read -r app_name app_path bundle_id total_kb encoded_files encoded_system_files <<< "$detail" IFS='|' read -r app_name app_path bundle_id total_kb encoded_files encoded_system_files <<< "$detail"

BIN
mole-analyze Executable file

Binary file not shown.