public LabColor(byte red, byte green, byte blue, byte alpha = 255) { LabColor labColor = LabColor.FromArgb(red, green, blue, alpha); this.L = labColor.L; this.A = labColor.A; this.B = labColor.B; this.Alpha = labColor.Alpha; this._color = Color.FromArgb(alpha, red, green, blue); }
/// <summary> /// Converts a Color to its CIE-LAB color equivalent. /// If Alpha channel is used, it is preserved but not converted. /// </summary> /// <param name="color"></param> /// <returns></returns> public static LabColor FromColor(Color color) { return(LabColor.FromArgb(color.R, color.G, color.B, color.A)); }