- if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE))
- {
- if (tty->TN_max_colors > 0)
- {
- if (fg >= 0 && bg >= 0)
- {
- /* If the terminal supports colors, we can set them
- below without using reverse video. The face's fg
- and bg colors are set as they should appear on
- the screen, i.e. they take the inverse-video'ness
- of the face already into account. */
- }
- else if (inverse_video)
- {
- if (fg == FACE_TTY_DEFAULT_FG_COLOR
- || bg == FACE_TTY_DEFAULT_BG_COLOR)
- tty_toggle_highlight (tty);
- }
- else
- {
- if (fg == FACE_TTY_DEFAULT_BG_COLOR
- || bg == FACE_TTY_DEFAULT_FG_COLOR)
- tty_toggle_highlight (tty);
- }
- }
- else
- {
- /* If we can't display colors, use reverse video
- if the face specifies that. */
- if (inverse_video)
- {
- if (fg == FACE_TTY_DEFAULT_FG_COLOR
- || bg == FACE_TTY_DEFAULT_BG_COLOR)
- tty_toggle_highlight (tty);
- }
- else
- {
- if (fg == FACE_TTY_DEFAULT_BG_COLOR
- || bg == FACE_TTY_DEFAULT_FG_COLOR)
- tty_toggle_highlight (tty);
- }
- }
- }
+ if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE)
+ && (inverse_video
+ ? fg == FACE_TTY_DEFAULT_FG_COLOR || bg == FACE_TTY_DEFAULT_BG_COLOR
+ : fg == FACE_TTY_DEFAULT_BG_COLOR || bg == FACE_TTY_DEFAULT_FG_COLOR))
+ tty_toggle_highlight (tty);