예제 #1
0
            /// <summary>
            /// Creates RBG Data from user provided arrays of ushorts and decimals.
            /// </summary>
            /// <param name="values">An array of ushorts representing RGB values ([0]:Red, [1]:Green, [2]:Blue)</param>
            /// <param name="fraction">An array of decimals representing RGB fractions ([0]:Red, [1]:Green, [2]:Blue)</param>
            public rgb(ushort[] values, decimal[] fraction)
            {
                Values   = new ColorfulGeneric.RGB <ushort>();
                Fraction = new ColorfulGeneric.RGB <decimal>();

                Values.Red   = values[0];
                Values.Green = values[1];
                Values.Blue  = values[2];

                Fraction.Red   = fraction[0];
                Fraction.Green = fraction[1];
                Fraction.Blue  = fraction[2];
            }
예제 #2
0
            /// <summary>
            /// Creates RGB Data from ColorfulJsonParser RGB data
            /// </summary>
            /// <param name="jsonData">ColorfulJsonParser.rgbData object</param>
            public rgb(object jsonData)
            {
                var _rgbData = (rgbData)jsonData;

                Values       = new ColorfulGeneric.RGB <ushort>();
                Values.Red   = _rgbData.r;
                Values.Green = _rgbData.g;
                Values.Blue  = _rgbData.b;

                Fraction       = new ColorfulGeneric.RGB <decimal>();
                Fraction.Red   = _rgbData.Fraction.r;
                Fraction.Green = _rgbData.Fraction.g;
                Fraction.Blue  = _rgbData.Fraction.b;
            }