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