create_lagrange() must preserve the first and last control colors as endpoints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_046(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "Colormap%create_lagrange: endpoints equal control colors" logical :: ok type(Colormap) :: cm integer :: colors(2,3) integer :: r, g, b colors(1,:) = [ 0, 128, 255 ] colors(2,:) = [ 255, 64, 0 ] call cm%create_lagrange("lag", 0.0_wp, 1.0_wp, colors, 32) call cm%get_RGB(0, r, g, b) ok = (r == colors(1,1)) .and. (g == colors(1,2)) .and. (b == colors(1,3)) call cm%get_RGB(cm%get_levels()-1, r, g, b) ok = ok .and. (r == colors(2,1)) .and. (g == colors(2,2)) .and. (b == colors(2,3)) call report_test(name, ok, id, nfail) end subroutine test_046