/// <summary> /// Creates XYZ Data from user provided arrays of ushorts and decimals. /// </summary> /// <param name="values">An array of ushorts representing XYZ values ([0]:X, [1]:Y, [2]:Z)</param> /// <param name="fraction">An array of decimals representing XYZ fractions ([0]:X, [1]:Y, [2]:Z)</param> public xyz(ushort[] values, decimal[] fraction) { Values = new ColorfulGeneric.XYZ<ushort>(); Values.X = values[0]; Values.Y = values[1]; Values.Z = values[2]; Fraction = new ColorfulGeneric.XYZ<decimal>(); Fraction.X = fraction[0]; Fraction.Y = fraction[1]; Fraction.Z = fraction[2]; }
/// <summary> /// Creates XYZ Data from ColorfulJsonParser XYZ data /// </summary> /// <param name="jsonData">ColorfulJsonParser.xyzData object</param> public xyz(object jsonData) { var _xyzData = (xyzData)jsonData; Values = new ColorfulGeneric.XYZ<ushort>(); Values.X = _xyzData.x; Values.Y = _xyzData.y; Values.Z = _xyzData.z; Fraction = new ColorfulGeneric.XYZ<decimal>(); Fraction.X = _xyzData.fraction.x; Fraction.Y = _xyzData.fraction.y; Fraction.Z = _xyzData.fraction.z; }