/// <summary>
        /// Converts CIEXYZ to CIELab structure.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <param name="y">The y.</param>
        /// <param name="z">The z.</param>
        /// <returns>CIELab.</returns>
        public static CIELab XYZtoLab(double x, double y, double z)
        {
            CIELab lab = CIELab.Empty;

            lab.L = 116.0 * Fxyz(y / CIEXYZ.D65.Y) - 16;
            lab.A = 500.0 * (Fxyz(x / CIEXYZ.D65.X) - Fxyz(y / CIEXYZ.D65.Y));
            lab.B = 200.0 * (Fxyz(y / CIEXYZ.D65.Y) - Fxyz(z / CIEXYZ.D65.Z));

            return(lab);
        }
 /// <summary>
 /// Converts CIELab to RGB.
 /// </summary>
 /// <param name="lab">The lab.</param>
 /// <returns>RGB.</returns>
 public static RGB LabtoRGB(CIELab lab)
 {
     return(XYZtoRGB(LabtoXYZ(lab)));
 }
 /// <summary>
 /// Converts CIELab to CIEXYZ.
 /// </summary>
 /// <param name="lab">The lab.</param>
 /// <returns>CIEXYZ.</returns>
 public static CIEXYZ LabtoXYZ(CIELab lab)
 {
     return(LabtoXYZ(lab.L, lab.A, lab.B));
 }