Files
claude-hud/dist/render/colors.js
Jarrod Watts 7ce11b1ea9 fix: add marketplace.json and correct plugin installation flow
The previous installation command didn't work because Claude Code
plugins require a marketplace manifest. This adds the marketplace.json
and updates install instructions to the correct two-step flow:

1. /plugin marketplace add jarrodwatts/claude-hud
2. /plugin install claude-hud@claude-hud

Also commits dist/ for plugin distribution since users can't run
npm build when installing via marketplace.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 21:51:51 +11:00

39 lines
1.0 KiB
JavaScript

export const RESET = '\x1b[0m';
const DIM = '\x1b[2m';
const RED = '\x1b[31m';
const GREEN = '\x1b[32m';
const YELLOW = '\x1b[33m';
const MAGENTA = '\x1b[35m';
const CYAN = '\x1b[36m';
export function green(text) {
return `${GREEN}${text}${RESET}`;
}
export function yellow(text) {
return `${YELLOW}${text}${RESET}`;
}
export function red(text) {
return `${RED}${text}${RESET}`;
}
export function cyan(text) {
return `${CYAN}${text}${RESET}`;
}
export function magenta(text) {
return `${MAGENTA}${text}${RESET}`;
}
export function dim(text) {
return `${DIM}${text}${RESET}`;
}
export function getContextColor(percent) {
if (percent >= 85)
return RED;
if (percent >= 70)
return YELLOW;
return GREEN;
}
export function coloredBar(percent, width = 10) {
const filled = Math.round((percent / 100) * width);
const empty = width - filled;
const color = getContextColor(percent);
return `${color}${'█'.repeat(filled)}${DIM}${'░'.repeat(empty)}${RESET}`;
}
//# sourceMappingURL=colors.js.map