ansi_bg_rgb Function

public pure function ansi_bg_rgb(r, g, b) result(seq)

Set the background to a 24-bit colour.

Arguments

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

Red, clamped to 0 to 255.

integer(kind=int32), intent(in) :: g

Green, clamped to 0 to 255.

integer(kind=int32), intent(in) :: b

Blue, clamped to 0 to 255.

Return Value character(len=:), allocatable


Calls

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

Source Code

   pure function ansi_bg_rgb(r, g, b) result(seq)
      !! Set the background to a 24-bit colour.
      integer(int32), intent(in) :: r
         !! Red, clamped to 0 to 255.
      integer(int32), intent(in) :: g
         !! Green, clamped to 0 to 255.
      integer(int32), intent(in) :: b
         !! Blue, clamped to 0 to 255.
      character(len=:), allocatable :: seq

      seq = CSI//"48;2;"//to_string(clamp_byte(r))//";"//to_string(clamp_byte(g))// &
            ";"//to_string(clamp_byte(b))//"m"
   end function ansi_bg_rgb