ansi_fg Function

public pure function ansi_fg(color) result(seq)

Set the foreground to one of the sixteen named colours.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: color

One of the ANSI_* colour constants, 0 to 15.

Return Value character(len=:), allocatable


Calls

proc~~ansi_fg~~CallsGraph proc~ansi_fg ansi_fg interface~to_string to_string proc~ansi_fg->interface~to_string proc~base_code base_code proc~ansi_fg->proc~base_code

Called by

proc~~ansi_fg~~CalledByGraph proc~ansi_fg ansi_fg proc~styled styled proc~styled->proc~ansi_fg

Source Code

   pure function ansi_fg(color) result(seq)
      !! Set the foreground to one of the sixteen named colours.
      integer(int32), intent(in) :: color
         !! One of the ANSI_* colour constants, 0 to 15.
      character(len=:), allocatable :: seq

      seq = CSI//to_string(base_code(color, 30_int32))//"m"
   end function ansi_fg