compute_RGB() should clamp z below/above the bounds to the first/last color.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_042(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "Colormap%compute_RGB: clamps z outside bounds" logical :: ok type(Colormap) :: cm integer :: map(2,3) integer :: r, g, b map(1,:) = [ 1, 2, 3 ] map(2,:) = [ 11, 12, 13 ] call cm%create("custom", 0.0_wp, 1.0_wp, map) call cm%compute_RGB(-10.0_wp, r, g, b) ok = (r == 1) .and. (g == 2) .and. (b == 3) call cm%compute_RGB( 10.0_wp, r, g, b) ok = ok .and. (r == 11) .and. (g == 12) .and. (b == 13) call report_test(name, ok, id, nfail) end subroutine test_042