subroutine check(tol, name, r, g, b, hex, decimal, c, m, y, k, h, s, v, hl, sl, vl, xyz_x, xyz_y, xyz_z)
character(len=*), intent(in) :: name
integer(ik), intent(in) :: r, g, b
character(len=*), intent(in) :: hex
integer(ik), intent(in) :: decimal
integer(ik), intent(in) :: c, m, y, k
real(rk), intent(in) :: h, s, v
real(rk), intent(in) :: hl, sl, vl
real(rk), intent(in) :: xyz_x, xyz_y, xyz_z
real(rk), intent(in) :: tol
! check output:
if (name /= 'custom_color') print *, 'ERROR: name /= ''custom_color'''
if (r /= 245_ik) print *, 'ERROR: r /= 245'
if (g /= 127_ik) print *, 'ERROR: g /= 127'
if (b /= 64_ik) print *, 'ERROR: b /= 64'
if (hex /= '#F57F40') print *, 'ERROR: hex /= ''#F57F40'''
if (decimal /= 16088896_ik) print *, 'ERROR: decimal /= 16088896'
if (c /= 0_ik) print *, 'ERROR: c /= 0'
if (m /= 48_ik) print *, 'ERROR: m /= 48'
if (y /= 74_ik) print *, 'ERROR: y /= 74'
if (k /= 4_ik) print *, 'ERROR: k /= 4'
if (abs(h - 20.883977900552487_rk) > tol ) print *, 'ERROR: h /= 20.8840'
if (abs(s - 73.877551020408163_rk) > tol ) print *, 'ERROR: s /= 73.8776'
if (abs(v - 96.078431372549019_rk) > tol ) print *, 'ERROR: v /= 96.0784'
if (abs(hl - 20.883977900552487_rk) > tol ) print *, 'ERROR: hl /= 20.8840'
if (abs(sl - 90.049751243781117_rk) > tol ) print *, 'ERROR: sl /= 90.0498'
if (abs(vl - 60.588235294117652_rk) > tol ) print *, 'ERROR: vl /= 60.5882'
if (abs(xyz_x - 46.175296219509761_rk) > tol ) print *, 'ERROR: xyz_x /= 46.1753'
if (abs(xyz_y - 34.966900449347115_rk) > tol ) print *, 'ERROR: xyz_y /= 34.9669'
if (abs(xyz_z - 9.1671542959237478_rk) > tol ) print *, 'ERROR: xyz_z /= 9.1672'
end subroutine check