set Subroutine

private pure elemental subroutine set(this, name, r, g, b, c, m, y, k, decimal, hex, h, s, v, hl, sl, vl, xyz_x, xyz_y, xyz_z, use_library)

Type Bound

color

Arguments

Type IntentOptional Attributes Name
class(color), intent(inout) :: this
character(len=*), intent(in) :: name
integer(kind=ik), intent(in), optional :: r
integer(kind=ik), intent(in), optional :: g
integer(kind=ik), intent(in), optional :: b
integer(kind=ik), intent(in), optional :: c
integer(kind=ik), intent(in), optional :: m
integer(kind=ik), intent(in), optional :: y
integer(kind=ik), intent(in), optional :: k
integer(kind=ik), intent(in), optional :: decimal
character(len=*), intent(in), optional :: hex
real(kind=rk), intent(in), optional :: h
real(kind=rk), intent(in), optional :: s
real(kind=rk), intent(in), optional :: v
real(kind=rk), intent(in), optional :: hl
real(kind=rk), intent(in), optional :: sl
real(kind=rk), intent(in), optional :: vl
real(kind=rk), intent(in), optional :: xyz_x
real(kind=rk), intent(in), optional :: xyz_y
real(kind=rk), intent(in), optional :: xyz_z
logical, intent(in), optional :: use_library

Calls

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

Called by

proc~~set~~CalledByGraph proc~set color%set proc~set_by_name color%set_by_name proc~set->proc~set_by_name proc~initialize_colors initialize_colors 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 proc~set_by_name->proc~initialize_colors program~example29 example29 program~example29->proc~print_available_colors program~example29->proc~save_available_colors

Source Code

   elemental pure subroutine set(this, name, r,g,b, c,m,y,k, decimal, hex, h,s,v, hl,sl,vl, xyz_x,xyz_y,xyz_z, use_library)
      class(color), intent(inout) :: this
      character(len=*), intent(in) :: name
      integer(ik),  intent(in), optional :: r, g, b, c, m, y, k, decimal
      character(len=*), intent(in), optional :: hex
      real(rk),     intent(in), optional :: h, s, v, hl, sl, vl, xyz_x, xyz_y, xyz_z
      logical,      intent(in), optional :: use_library
      logical :: use_library_

      if (present(use_library)) then
         use_library_ = use_library
      else
         use_library_ = .false.
      end if

      if (use_library_) then
         call this%set_by_name(name)
      else
         call this%set_name(name)
         if (present(r) .and. present(g) .and. present(b))                  call this%set_rgb(r, g, b)
         if (present(c) .and. present(m) .and. present(y) .and. present(k)) call this%set_cmyk(c, m, y, k)
         if (present(decimal))                                              call this%set_decimal(decimal)
         if (present(hex))                                                  call this%set_hex(hex)
         if (present(h) .and. present(s) .and. present(v))                  call this%set_hsv(h, s, v)
         if (present(hl) .and. present(sl) .and. present(vl))               call this%set_hsl(hl, sl, vl)
         if (present(xyz_x) .and. present(xyz_y) .and. present(xyz_z))      call this%set_xyz(xyz_x, xyz_y, xyz_z)
      end if
   end subroutine set