ansi_fg_256 Function

public pure function ansi_fg_256(index) result(seq)

Set the foreground from the 256-colour cube.

Arguments

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

Palette index, clamped to 0 to 255.

Return Value character(len=:), allocatable


Calls

proc~~ansi_fg_256~~CallsGraph proc~ansi_fg_256 ansi_fg_256 interface~to_string to_string proc~ansi_fg_256->interface~to_string proc~clamp_byte clamp_byte proc~ansi_fg_256->proc~clamp_byte

Source Code

   pure function ansi_fg_256(index) result(seq)
      !! Set the foreground from the 256-colour cube.
      integer(int32), intent(in) :: index
         !! Palette index, clamped to 0 to 255.
      character(len=:), allocatable :: seq

      seq = CSI//"38;5;"//to_string(clamp_byte(index))//"m"
   end function ansi_fg_256