rgba from [r, g, b] (alpha 1) or [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=c_float), | intent(out) | :: | rgba(4) |
[r, g, b, a] |
||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
pure subroutine to_float_rgba(rgba, color) real(c_float), intent(out) :: rgba(4) !! [r, g, b, a] real(wp), intent(in) :: color(:) !! [r, g, b] or [r, g, b, a] (0 to 1) integer :: n n = min(4, size(color)) rgba = 1.0_c_float rgba(1:n) = real(color(1:n), c_float) end subroutine to_float_rgba