public static Color LABtoRGB(cLAB LAB) { cXYZ xyz = LABtoXYZ(LAB); Color rgb = XYZtoRGB(xyz); return(rgb); }
public static double XYZtoDelta(cXYZ c1, cXYZ c2) { cLAB lab1 = XYZtoLAB(c1); cLAB lab2 = XYZtoLAB(c2); return(LABtoDelta(lab1, lab2)); }
public static cLAB RGBtoLAB(Color rgb) { cXYZ xyz = RGBtoXYZ(rgb.R, rgb.G, rgb.B); cLAB lab = XYZtoLAB(xyz); return(lab); }
public static Color LABtoRGB(double L, double a, double b) { cXYZ xyz = LABtoXYZ(L, a, b); Color rgb = XYZtoRGB(xyz); return(rgb); }
public static cLAB RGBtoLAB(int r, int g, int b) { cXYZ xyz = RGBtoXYZ(r, g, b); cLAB lab = XYZtoLAB(xyz); return(lab); }
public static cXYZ LABtoXYZ(double L, double a, double b) { double _Y = (L + 16d) / 116d; double _X = a / 500d + _Y; double _Z = _Y - b / 200d; _X = Math.Pow(_X, 3d) > 0.008856d ? Math.Pow(_X, 3d) : (_X - 16d / 116d) / 7.787d; _Y = Math.Pow(_Y, 3d) > 0.008856d ? Math.Pow(_Y, 3d) : (_Y - 16d / 116d) / 7.787d; _Z = Math.Pow(_Z, 3d) > 0.008856d ? Math.Pow(_Z, 3d) : (_Z - 16d / 116d) / 7.787d; cXYZ xyz = new cXYZ(); xyz.X = 95.047d * _X; xyz.Y = 100d * _Y; xyz.Z = 108.883d * _Z; return(xyz); }
public static cXYZ RGBtoXYZ(int r, int g, int b) { double _R = r / 255d; double _G = g / 255d; double _B = b / 255d; _R = (_R > 0.04045d ? Math.Pow((_R + 0.055d) / 1.055d, 2.4d) : _R / 12.92d) * 100d; _G = (_G > 0.04045d ? Math.Pow((_G + 0.055d) / 1.055d, 2.4d) : _G / 12.92d) * 100d; _B = (_B > 0.04045d ? Math.Pow((_B + 0.055d) / 1.055d, 2.4d) : _B / 12.92d) * 100d; cXYZ xyz = new cXYZ(); xyz.X = _R * 0.4124d + _G * 0.3576d + _B * 0.1805d; xyz.Y = _R * 0.2126d + _G * 0.7152d + _B * 0.0722d; xyz.Z = _R * 0.0193d + _G * 0.1192d + _B * 0.9505d; return(xyz); }
public static cXYZ LABtoXYZ(cLAB LAB) { cXYZ xyz = LABtoXYZ(LAB.L, LAB.a, LAB.b); return(xyz); }
public static Color XYZtoRGB(cXYZ XYZ) { Color rgb = XYZtoRGB(XYZ); return(rgb); }
public static cLAB XYZtoLAB(cXYZ XYZ) { cLAB lab = XYZtoLAB(XYZ.X, XYZ.Y, XYZ.Z); return(lab); }
public static cXYZ RGBtoXYZ(Color rgb) { cXYZ xyz = RGBtoXYZ(rgb.R, rgb.G, rgb.B); return(xyz); }