color_mode(3f) - [M_escape] toggle style effects of color(3f) on and off (LICENSE:PD)
Synopsis
Description
Options
Example
Author
License
subroutine color_mode(switch)
logical,intent(in) :: switch
The color constant strings can be used directly but unconditionally in an output statement. To allow the attributes to be ignored they can be called with the color(3f) routine, which the color_mode(3f) procedure can be used to toggle on and off. Note that this routine does an implicit reset at the end of each use.
switch turn attributes set by color(3f) on and off
Sample program
program demo_color_mode use M_escape, only : color, color_mode, & ! FOREGROUND COLORS & fg_red, fg_cyan, fg_magenta, fg_blue, & & fg_green, fg_yellow, fg_white, fg_ebony, & & fg_default, & ! BACKGROUND COLORS & bg_red, bg_cyan, bg_magenta, bg_blue, & & bg_green, bg_yellow, bg_white, bg_ebony, & & bg_default, & ! ATTRIBUTES & bold, italic, inverse, underline, & & unbold, unitalic, uninverse, ununderline, & & reset, & ! DISPLAY & clear implicit none write(*,(*(g0)))fg_red,bg_green,bold, Hello! ,resetwrite(*,(a))color( Hello! ,& & fg=fg_white,bg=bg_red,style=italic//bold) call color_mode(.false.) write(*,(a))color( Hello! ,& & fg=fg_red,bg=bg_red,style=italic//bold) end program demo_color_mode
John S. Urban, 2020
Public Domain
color_mode (3) | March 11, 2021 |