color_index Function

private elemental function color_index(color)

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: color

Return Value integer(kind=int32)


Called by

proc~~color_index~~CalledByGraph proc~color_index color_index proc~colorize_ascii colorize_ascii proc~colorize_ascii->proc~color_index proc~colorize_default colorize_default proc~colorize_default->proc~color_index proc~colorize_ucs4 colorize_ucs4 proc~colorize_ucs4->proc~color_index interface~colorize colorize interface~colorize->proc~colorize_default proc~colorize_str colorize_str proc~colorize_str->interface~colorize proc~styles_samples styles_samples proc~styles_samples->interface~colorize proc~colorize_str~2 colorize_str proc~colorize_str~2->interface~colorize program~face_test_colors face_test_colors program~face_test_colors->interface~colorize program~face_test_styles~2 face_test_styles program~face_test_styles~2->interface~colorize program~face_test_styles~3 face_test_styles program~face_test_styles~3->interface~colorize program~face_test_colors~4 face_test_colors program~face_test_colors~4->interface~colorize proc~colors_samples colors_samples proc~colors_samples->interface~colorize program~face_test_styles face_test_styles program~face_test_styles->interface~colorize program~face_test_colors~2 face_test_colors program~face_test_colors~2->interface~colorize program~face_test_colors~3 face_test_colors program~face_test_colors~3->interface~colorize program~face_test_styles~4 face_test_styles program~face_test_styles~4->interface~colorize program~face_test_basic face_test_basic program~face_test_basic->proc~styles_samples program~face_test_basic->proc~colors_samples program~face_test_basic~2 face_test_basic program~face_test_basic~2->proc~styles_samples program~face_test_basic~2->proc~colors_samples program~face_test_basic~3 face_test_basic program~face_test_basic~3->proc~styles_samples program~face_test_basic~3->proc~colors_samples program~face_test_basic~4 face_test_basic program~face_test_basic~4->proc~styles_samples program~face_test_basic~4->proc~colors_samples

Contents

Source Code


Source Code

   elemental function color_index(color)
   !< Return the array-index corresponding to the queried color.
   !<
   !< @note Because Foreground and backround colors lists share the same name, no matter what array is used to find the color index.
   !< Thus, the foreground array is used.
   character(len=*), intent(in) :: color       !< Color definition.
   integer(int32)               :: color_index !< Index into the colors arrays.
   integer(int32)               :: c           !< Counter.

   color_index = 0
   do c=1, size(COLORS_FG, dim=2)
      if (trim(COLORS_FG(1, c))==trim(adjustl(color))) then
         color_index = c
         exit
      endif
   enddo
   endfunction color_index