/// <summary> /// Creates CMYK Data from user provided arrays of ushorts and decimals. /// </summary> /// <param name="values">An array of ushorts representing CMYK values ([0]:Cyan, [1]:Magenta, [2]:Yellow [3]:Key)</param> /// <param name="fraction">An array of decimals representing CMYK fractions ([0]:Cyan, [1]:Magenta, [2]:Yellow [3]:Key)</param> public cmyk(ushort[] values, decimal[] fraction) { Values = new ColorfulGeneric.CMYK<ushort>(); Values.C = values[0]; Values.M = values[1]; Values.Y = values[2]; Values.K = values[3]; Fraction = new ColorfulGeneric.CMYK<decimal>(); Fraction.C = fraction[0]; Fraction.M = fraction[1]; Fraction.Y = fraction[2]; Fraction.K = fraction[3]; }
/// <summary> /// Creates CMYK Data from ColorfulJsonParser CMYK data /// </summary> /// <param name="jsonData">ColorfulJsonParser.cmykData object</param> public cmyk(object jsonData) { var _cmykData = (cmykData)jsonData; Values = new ColorfulGeneric.CMYK<ushort>(); Values.C = _cmykData.c; Values.M = _cmykData.m; Values.Y = _cmykData.y; Values.K = _cmykData.k; Fraction = new ColorfulGeneric.CMYK<decimal>(); Fraction.C = _cmykData.fraction.c; Fraction.M = _cmykData.fraction.m; Fraction.Y = _cmykData.fraction.y; Fraction.K = _cmykData.fraction.k; }