[UP]


Manual Reference Pages  - color_mode (3)

NAME

color_mode(3f) - [M_escape] toggle style effects of color(3f) on and off (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine color_mode(switch)

     logical,intent(in) :: switch

DESCRIPTION

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.

OPTIONS

switch turn attributes set by color(3f) on and off

EXAMPLE

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! ’,reset

write(*,’(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

AUTHOR

John S. Urban, 2020

LICENSE

Public Domain


color_mode (3) March 11, 2021
Generated by manServer 1.08 from dca96eb1-3703-40ec-b733-c9e225f279b5 using man macros.