File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ def cycle(self) -> ColorMode:
2020 value += 1
2121 return ColorMode (value )
2222
23+ def report (self ) -> str :
24+ """Return a human-readable report of the color mode."""
25+ if self == ColorMode .COULD_NOT_DETECT :
26+ return "Could not detect color mode"
27+ if self == ColorMode .HAS_2_BIT_COLOR :
28+ return "4 colors"
29+ if self == ColorMode .HAS_4_BIT_COLOR :
30+ return "16 colors"
31+ if self == ColorMode .HAS_8_BIT_COLOR :
32+ return "256 colors"
33+ if self == ColorMode .HAS_24_BIT_COLOR :
34+ return "True color"
35+ assert False
36+
2337
2438def detect_local_color_mode (term : Terminal ) -> ColorMode :
2539 """Detect the color mode of the local terminal using blessed."""
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ def run(
205205 title += f"Emu: { emu_fps :.0f} FPS - { emu_percent :.0f} % CPU | "
206206 title += f"Video: { video_fps :.0f} FPS - { video_percent :.0f} % CPU - "
207207 title += f"{ data_rate :.0f} KB/s | "
208- title += f"Audio: { audio_percent :.0f} % CPU"
208+ title += f"Audio: { audio_percent :.0f} % CPU | "
209+ title += f"{ color_mode .report ()} mode"
209210 term .stream .write (term .set_window_title (title ))
210211 term .stream .flush ()
You can’t perform that action at this time.
0 commit comments