Skip to content

Commit

Permalink
fix: ensure project names are readable in dark terminals
Browse files Browse the repository at this point in the history
In terminals using a color scheme with a dark background, project names
could end up being unreadable because one of the hard-coded background
colors used for project names was black. Replacing black with blue
solves this problem while also ensuring that project names remain
readable in terminals with light backgrounds.
  • Loading branch information
rgrove committed Jan 28, 2025
1 parent 9acc13f commit 1d16da8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/node/reporters/renderers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ 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.blue, c.yellow, c.cyan, c.green, c.magenta]

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

0 comments on commit 1d16da8

Please sign in to comment.