ansi_fg_rgb Function

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

Set the foreground 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_fg_rgb~~CallsGraph proc~ansi_fg_rgb ansi_fg_rgb interface~to_string to_string proc~ansi_fg_rgb->interface~to_string proc~clamp_byte clamp_byte proc~ansi_fg_rgb->proc~clamp_byte

Source Code

   pure function ansi_fg_rgb(r, g, b) result(seq)
      !! Set the foreground 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//"38;2;"//to_string(clamp_byte(r))//";"//to_string(clamp_byte(g))// &
            ";"//to_string(clamp_byte(b))//"m"
   end function ansi_fg_rgb