Skip to content

Commit bb94c19

Browse files
authoredFeb 10, 2025··
fix: ensure project names are readable in dark terminals (#7371)
1 parent 6a9cb9c commit bb94c19

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎packages/ui/client/utils/task.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ export function getProjectNameColor(name: string | undefined) {
2525
const index = name
2626
.split('')
2727
.reduce((acc, v, idx) => acc + v.charCodeAt(0) + idx, 0)
28-
const colors = ['blue', 'yellow', 'cyan', 'green', 'magenta']
28+
const colors = ['yellow', 'cyan', 'green', 'magenta']
2929
return colors[index % colors.length]
3030
}

‎packages/vitest/src/node/reporters/renderers/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ export function formatProjectName(name: string | undefined, suffix = ' ') {
223223
.split('')
224224
.reduce((acc, v, idx) => acc + v.charCodeAt(0) + idx, 0)
225225

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

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.