initialize_colors Subroutine

private pure subroutine initialize_colors(colors)

Arguments

Type IntentOptional Attributes Name
type(color), intent(out), dimension(:), allocatable :: colors

Calls

proc~~initialize_colors~~CallsGraph proc~initialize_colors 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_by_name color%set_by_name 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 proc~set_by_name->proc~initialize_colors

Called by

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

Source Code

   pure subroutine initialize_colors(colors)
      type(color), intent(out), dimension(:), allocatable :: colors

      allocate(colors(14))

      call colors(1)%set( name='red',           r=255_ik,    g=0_ik,      b=0_ik)
      call colors(2)%set( name='green',         r=0_ik,      g=128_ik,    b=0_ik)
      call colors(3)%set( name='blue',          r=0_ik,      g=0_ik,      b=255_ik)
      call colors(4)%set( name='yellow',        r=255_ik,    g=255_ik,    b=0_ik)
      call colors(5)%set( name='cyan',          r=0_ik,      g=255_ik,    b=255_ik)
      call colors(6)%set( name='magenta',       r=255_ik,    g=0_ik,      b=255_ik)
      call colors(7)%set( name='black',         r=0_ik,      g=0_ik,      b=0_ik)
      call colors(8)%set( name='white',         r=255_ik,    g=255_ik,    b=255_ik)
      call colors(9)%set( name='gray',          r=128_ik,    g=128_ik,    b=128_ik)
      call colors(10)%set(name='brown',         r=165_ik,    g=42_ik,     b=42_ik)
      call colors(11)%set(name='orange',        r=255_ik,    g=165_ik,    b=0_ik)
      call colors(12)%set(name='gold',          r=255_ik,    g=215_ik,    b=0_ik)
      call colors(13)%set(name='pink',          r=255_ik,    g=192_ik,    b=203_ik)
      call colors(14)%set(name='violet',        r=138_ik,    g=43_ik,     b=226_ik)

      call colors(1:14)%convert('rgb2all')
   end subroutine initialize_colors