rgba Subroutine

private pure subroutine rgba(c, out)

Colors c (3 or 4 rows) into rgba(4, n) (alpha 1 if not given).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: c(:,:)

(3 or 4, n): [r, g, b(, a)] (0 to 1)

real(kind=c_float), intent(out) :: out(:,:)

(4, n): [r, g, b, a]


Called by

proc~~rgba~~CalledByGraph proc~rgba rgba proc~set_segments CustomLineSegments%set_segments proc~set_segments->proc~rgba proc~clear_segments CustomLineSegments%clear_segments proc~clear_segments->proc~set_segments

Source Code

    pure subroutine rgba(c, out)
        real(wp), intent(in) :: c(:,:)              !! (3 or 4, n): [r, g, b(, a)] (0 to 1)
        real(c_float), intent(out) :: out(:,:)      !! (4, n): [r, g, b, a]
        integer :: n, m
        n = min(size(c, 2), size(out, 2))
        m = min(4, size(c, 1))
        out = 1.0_c_float
        out(1:m, 1:n) = real(c(1:m, 1:n), c_float)
    end subroutine rgba