Skip to content

Commit

Permalink
fix: ensure project names are readable in dark terminals (#7371)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrove authored Feb 10, 2025
1 parent 6a9cb9c commit bb94c19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ui/client/utils/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export function getProjectNameColor(name: string | undefined) {
const index = name
.split('')
.reduce((acc, v, idx) => acc + v.charCodeAt(0) + idx, 0)
const colors = ['blue', 'yellow', 'cyan', 'green', 'magenta']
const colors = ['yellow', 'cyan', 'green', 'magenta']
return colors[index % colors.length]
}
4 changes: 2 additions & 2 deletions packages/vitest/src/node/reporters/renderers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ export function formatProjectName(name: string | undefined, suffix = ' ') {
.split('')
.reduce((acc, v, idx) => acc + v.charCodeAt(0) + idx, 0)

const colors = [c.black, c.yellow, c.cyan, c.green, c.magenta]
const colors = [c.bgYellow, c.bgCyan, c.bgGreen, c.bgMagenta]

return c.inverse(colors[index % colors.length](` ${name} `)) + suffix
return c.black(colors[index % colors.length](` ${name} `)) + suffix
}

export function withLabel(color: 'red' | 'green' | 'blue' | 'cyan' | 'yellow', label: string, message?: string) {
Expand Down

0 comments on commit bb94c19

Please sign in to comment.