Skip to content

Commit 1ac9a48

Browse files
committed
fixup! fixup! fixup! Update _colorize.py
1 parent d3fff02 commit 1ac9a48

1 file changed

Lines changed: 9 additions & 22 deletions

File tree

Lib/_colorize.py

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# types
1111
if False:
12-
from typing import IO, Self, ClassVar
12+
from typing import IO, Literal, Self, ClassVar
1313
_theme: Theme
1414

1515

@@ -68,6 +68,11 @@ class ANSIColors:
6868
ColorCodes = set()
6969
NoColors = ANSIColors()
7070

71+
for attr, code in ANSIColors.__dict__.items():
72+
if not attr.startswith("__"):
73+
ColorCodes.add(code)
74+
setattr(NoColors, attr, "")
75+
7176

7277
class CursesColors:
7378
"""Curses color constants for terminal UI theming."""
@@ -81,11 +86,6 @@ class CursesColors:
8186
WHITE = 7
8287
DEFAULT = -1
8388

84-
for attr, code in ANSIColors.__dict__.items():
85-
if not attr.startswith("__"):
86-
ColorCodes.add(code)
87-
setattr(NoColors, attr, "")
88-
8989

9090
#
9191
# Experimental theming support (see gh-133346)
@@ -296,13 +296,12 @@ class LiveProfiler(ThemeSection):
296296
medal_bronze_fg: int = CursesColors.GREEN
297297

298298
# Background style: 'dark' or 'light'
299-
background_style: str = "dark"
299+
background_style: Literal["dark", "light"] = "dark"
300300

301301

302302
LiveProfilerLight = LiveProfiler(
303-
# Header colors - use black for better contrast on light bg
304-
title_fg=CursesColors.BLUE,
305-
title_bg=CursesColors.DEFAULT,
303+
# Header colors
304+
title_fg=CursesColors.BLUE, # Blue is more readable than cyan on light bg
306305

307306
# Status display colors - darker colors for light backgrounds
308307
pid_fg=CursesColors.BLUE,
@@ -314,13 +313,7 @@ class LiveProfiler(ThemeSection):
314313
thread_all_fg=CursesColors.BLACK,
315314
thread_single_fg=CursesColors.BLUE,
316315

317-
# Progress bar colors
318-
bar_good_fg=CursesColors.GREEN,
319-
bar_bad_fg=CursesColors.RED,
320-
321316
# Stats colors
322-
on_gil_fg=CursesColors.GREEN,
323-
off_gil_fg=CursesColors.RED,
324317
waiting_gil_fg=CursesColors.RED,
325318
gc_fg=CursesColors.BLUE,
326319

@@ -343,14 +336,8 @@ class LiveProfiler(ThemeSection):
343336
file_fg=CursesColors.BLACK,
344337
func_fg=CursesColors.BLUE, # Blue is more readable than magenta on light bg
345338

346-
# Trend indicator colors
347-
trend_up_fg=CursesColors.GREEN,
348-
trend_down_fg=CursesColors.RED,
349-
350339
# Medal colors for top functions
351-
medal_gold_fg=CursesColors.RED,
352340
medal_silver_fg=CursesColors.BLUE,
353-
medal_bronze_fg=CursesColors.GREEN,
354341

355342
# Background style
356343
background_style="light",

0 commit comments

Comments
 (0)