create() should accept a custom map and allow RGB lookup at the bounds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_041(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "Colormap%create: endpoints via compute_RGB" logical :: ok type(Colormap) :: cm integer :: map(3,3) integer :: r, g, b map(1,:) = [ 10, 20, 30 ] map(2,:) = [ 40, 50, 60 ] map(3,:) = [ 70, 80, 90 ] call cm%create("custom", 0.0_wp, 2.0_wp, map) call cm%compute_RGB(0.0_wp, r, g, b) ok = (r == 10) .and. (g == 20) .and. (b == 30) call cm%compute_RGB(2.0_wp, r, g, b) ok = ok .and. (r == 70) .and. (g == 80) .and. (b == 90) call report_test(name, ok, id, nfail) end subroutine test_041