colormap Subroutine

public pure subroutine colormap(t, r, g, b)

Return colour of colormap st%cmap at t.

'_r' suffix on name reverses colormap.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: t

Position in colormap, 0 to 1.

real(kind=real64), intent(out) :: r

Red component, 0 to 1.

real(kind=real64), intent(out) :: g

Green component, 0 to 1.

real(kind=real64), intent(out) :: b

Blue component, 0 to 1.


Source Code

   pure subroutine colormap(t, r, g, b)
      !! Return colour of colormap `st%cmap` at `t`.
      !!
      !! '_r' suffix on name reverses colormap.
      ! Arguments
      real(real64), intent(in) :: t
         !! Position in colormap, 0 to 1.
      real(real64), intent(out) :: r
         !! Red component, 0 to 1.
      real(real64), intent(out) :: g
         !! Green component, 0 to 1.
      real(real64), intent(out) :: b
         !! Blue component, 0 to 1.
      integer(int32) :: n
      n = len_trim(st%cmap)
      if (is_reversed(st%cmap)) then
         call cmap_rgb(st%cmap(1:n - 2), 1.d0 - t, r, g, b)
      else
         call cmap_rgb(st%cmap(1:n), t, r, g, b)
      end if
   end subroutine colormap