3232 FINISHED_BANNER_EXTRA_LINES ,
3333 DEFAULT_SORT_BY ,
3434 DEFAULT_DISPLAY_LIMIT ,
35+ COLOR_PAIR_SAMPLES ,
36+ COLOR_PAIR_FILE ,
37+ COLOR_PAIR_FUNC ,
3538 COLOR_PAIR_HEADER_BG ,
3639 COLOR_PAIR_CYAN ,
3740 COLOR_PAIR_YELLOW ,
@@ -532,36 +535,35 @@ def _setup_colors(self):
532535
533536 if self .display .has_colors () and self ._can_colorize :
534537 with contextlib .suppress (Exception ):
535- theme = _colorize .get_theme (force_color = True )
536- profiler_theme = theme .live_profiler
538+ theme = _colorize .get_theme (force_color = True ).live_profiler
537539 default_bg = - 1
538540
539- self .display .init_color_pair (1 , profiler_theme .samples_fg , default_bg )
540- self .display .init_color_pair (2 , profiler_theme .file_fg , default_bg )
541- self .display .init_color_pair (3 , profiler_theme .func_fg , default_bg )
541+ self .display .init_color_pair (COLOR_PAIR_SAMPLES , theme .samples_fg , default_bg )
542+ self .display .init_color_pair (COLOR_PAIR_FILE , theme .file_fg , default_bg )
543+ self .display .init_color_pair (COLOR_PAIR_FUNC , theme .func_fg , default_bg )
542544
543545 # Normal header background color pair
544546 self .display .init_color_pair (
545547 COLOR_PAIR_HEADER_BG ,
546- profiler_theme .normal_header_fg ,
547- profiler_theme .normal_header_bg ,
548+ theme .normal_header_fg ,
549+ theme .normal_header_bg ,
548550 )
549551
550- self .display .init_color_pair (COLOR_PAIR_CYAN , profiler_theme .pid_fg , default_bg )
551- self .display .init_color_pair (COLOR_PAIR_YELLOW , profiler_theme .time_fg , default_bg )
552- self .display .init_color_pair (COLOR_PAIR_GREEN , profiler_theme .uptime_fg , default_bg )
553- self .display .init_color_pair (COLOR_PAIR_MAGENTA , profiler_theme .interval_fg , default_bg )
554- self .display .init_color_pair (COLOR_PAIR_RED , profiler_theme .off_gil_fg , default_bg )
552+ self .display .init_color_pair (COLOR_PAIR_CYAN , theme .pid_fg , default_bg )
553+ self .display .init_color_pair (COLOR_PAIR_YELLOW , theme .time_fg , default_bg )
554+ self .display .init_color_pair (COLOR_PAIR_GREEN , theme .uptime_fg , default_bg )
555+ self .display .init_color_pair (COLOR_PAIR_MAGENTA , theme .interval_fg , default_bg )
556+ self .display .init_color_pair (COLOR_PAIR_RED , theme .off_gil_fg , default_bg )
555557 self .display .init_color_pair (
556558 COLOR_PAIR_SORTED_HEADER ,
557- profiler_theme .sorted_header_fg ,
558- profiler_theme .sorted_header_bg ,
559+ theme .sorted_header_fg ,
560+ theme .sorted_header_bg ,
559561 )
560562
561563 TREND_UP_PAIR = 11
562564 TREND_DOWN_PAIR = 12
563- self .display .init_color_pair (TREND_UP_PAIR , profiler_theme .trend_up_fg , default_bg )
564- self .display .init_color_pair (TREND_DOWN_PAIR , profiler_theme .trend_down_fg , default_bg )
565+ self .display .init_color_pair (TREND_UP_PAIR , theme .trend_up_fg , default_bg )
566+ self .display .init_color_pair (TREND_DOWN_PAIR , theme .trend_down_fg , default_bg )
565567
566568 return {
567569 "header" : self .display .get_color_pair (COLOR_PAIR_HEADER_BG ) | A_BOLD ,
@@ -572,9 +574,9 @@ def _setup_colors(self):
572574 "red" : self .display .get_color_pair (COLOR_PAIR_RED ) | A_BOLD ,
573575 "sorted_header" : self .display .get_color_pair (COLOR_PAIR_SORTED_HEADER ) | A_BOLD ,
574576 "normal_header" : self .display .get_color_pair (COLOR_PAIR_HEADER_BG ) | A_BOLD ,
575- "color_samples" : self .display .get_color_pair (1 ),
576- "color_file" : self .display .get_color_pair (2 ),
577- "color_func" : self .display .get_color_pair (3 ),
577+ "color_samples" : self .display .get_color_pair (COLOR_PAIR_SAMPLES ),
578+ "color_file" : self .display .get_color_pair (COLOR_PAIR_FILE ),
579+ "color_func" : self .display .get_color_pair (COLOR_PAIR_FUNC ),
578580 "trend_up" : self .display .get_color_pair (TREND_UP_PAIR ) | A_BOLD ,
579581 "trend_down" : self .display .get_color_pair (TREND_DOWN_PAIR ) | A_BOLD ,
580582 "trend_stable" : A_NORMAL ,
0 commit comments