reverse("discrete") should make the new first color equal the old last color.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_055(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "reverse(discrete) makes first=old last" logical :: ok type(Colormap) :: cmap integer, dimension(0:6, 3) :: test_colormap integer :: r, g, b test_colormap = reshape([ & 1, 2, 3, & 4, 5, 6, & 7, 8, 9, & 0, 0, 0, & 9, 8, 7, & 6, 5, 4, & 3, 2, 1 ], shape(test_colormap), order=[2,1]) call cmap%create("discrete", 0.0_wp, 2.0_wp, test_colormap) call cmap%reverse("discrete") call cmap%get_RGB(0, r, g, b) ok = (r == test_colormap(6,1)) .and. (g == test_colormap(6,2)) .and. (b == test_colormap(6,3)) call report_test(name, ok, id, nfail) end subroutine test_055