set_by_name Subroutine

private pure elemental subroutine set_by_name(this, name)

Type Bound

color

Arguments

Type IntentOptional Attributes Name
class(color), intent(inout) :: this
character(len=*), intent(in) :: name

Calls

proc~~set_by_name~~CallsGraph proc~set_by_name color%set_by_name proc~initialize_colors initialize_colors proc~set_by_name->proc~initialize_colors proc~convert color%convert proc~initialize_colors->proc~convert proc~set color%set proc~initialize_colors->proc~set proc~cmyk_to_rgb cmyk_to_rgb proc~convert->proc~cmyk_to_rgb proc~decimal_to_rgb decimal_to_rgb proc~convert->proc~decimal_to_rgb proc~hex_to_rgb hex_to_rgb proc~convert->proc~hex_to_rgb proc~hsl_to_rgb hsl_to_rgb proc~convert->proc~hsl_to_rgb proc~hsv_to_rgb hsv_to_rgb proc~convert->proc~hsv_to_rgb proc~rgb_to_cmyk rgb_to_cmyk proc~convert->proc~rgb_to_cmyk proc~rgb_to_decimal rgb_to_decimal proc~convert->proc~rgb_to_decimal proc~rgb_to_hex rgb_to_hex proc~convert->proc~rgb_to_hex proc~rgb_to_hsl rgb_to_hsl proc~convert->proc~rgb_to_hsl proc~rgb_to_hsv rgb_to_hsv proc~convert->proc~rgb_to_hsv proc~rgb_to_xyz rgb_to_xyz proc~convert->proc~rgb_to_xyz proc~xyz_to_rgb xyz_to_rgb proc~convert->proc~xyz_to_rgb proc~set->proc~set_by_name proc~set_cmyk color%set_cmyk proc~set->proc~set_cmyk proc~set_decimal color%set_decimal proc~set->proc~set_decimal proc~set_hex color%set_hex proc~set->proc~set_hex proc~set_hsl color%set_hsl proc~set->proc~set_hsl proc~set_hsv color%set_hsv proc~set->proc~set_hsv proc~set_name color%set_name proc~set->proc~set_name proc~set_rgb color%set_rgb proc~set->proc~set_rgb proc~set_xyz color%set_xyz proc~set->proc~set_xyz

Called by

proc~~set_by_name~~CalledByGraph proc~set_by_name color%set_by_name proc~initialize_colors initialize_colors proc~set_by_name->proc~initialize_colors proc~set color%set proc~set->proc~set_by_name proc~initialize_colors->proc~set program~demo_color demo_color program~demo_color->proc~set proc~find_nearest color%find_nearest program~demo_color->proc~find_nearest proc~print_available_colors color%print_available_colors program~demo_color->proc~print_available_colors proc~save_available_colors color%save_available_colors program~demo_color->proc~save_available_colors program~example26 example26 program~example26->proc~set program~example27 example27 program~example27->proc~set program~example27->proc~find_nearest program~example28 example28 program~example28->proc~set proc~find_nearest->proc~initialize_colors proc~print_available_colors->proc~initialize_colors proc~save_available_colors->proc~initialize_colors program~example29 example29 program~example29->proc~print_available_colors program~example29->proc~save_available_colors

Source Code

   elemental pure subroutine set_by_name(this, name)
      class(color),     intent(inout)        :: this
      character(len=*), intent(in)           :: name
      type(color), dimension(:), allocatable :: colors
      integer                                :: i

      call initialize_colors(colors)

      do concurrent (i = 1: size(colors))
         if (trim(colors(i)%color_name) == trim(name)) then
            this = colors(i)
         end if
      end do

   end subroutine set_by_name