/// <summary>
        /// Converts CIEXYZ to CIELab structure.
        /// </summary>
        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>
 public static RGB LabtoRGB(CIELab lab)
 {
     return(XYZtoRGB(LabtoXYZ(lab)));
 }
 /// <summary>
 /// Converts CIELab to CIEXYZ.
 /// </summary>
 public static CIEXYZ LabtoXYZ(CIELab lab)
 {
     return(LabtoXYZ(lab.L, lab.A, lab.B));
 }
 /// <summary>
 /// Converts CIELab to RGB.
 /// </summary>
 public static RGB LabtoRGB(CIELab lab) {
     return XYZtoRGB(LabtoXYZ(lab));
 }
 /// <summary>
 /// Converts CIELab to CIEXYZ.
 /// </summary>
 public static CIEXYZ LabtoXYZ(CIELab lab) {
     return LabtoXYZ(lab.L, lab.A, lab.B);
 }