Colors c (3 or 4 rows) into rgba(4, n) (alpha 1 if not given).
| Type | Intent | Optional | 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] |
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