Set the foreground to a 24-bit colour.
| Type | Intent | Optional | 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. |
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