Beispiel #1
0
        private static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve)
        {
            data.Add(color);

            if (color.Value == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                var easing = Utl.MathUtl.Easing((float)color_Easing.StartSpeed.Value, (float)color_Easing.EndSpeed.Value);
                data.Add((byte[])color_Easing.Start);
                data.Add((byte[])color_Easing.End);
                data.Add(BitConverter.GetBytes(easing[0]));
                data.Add(BitConverter.GetBytes(easing[1]));
                data.Add(BitConverter.GetBytes(easing[2]));
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
        }
        private static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve)
        {
            data.Add(color);

            if (color.Value == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                AddColorEasing(data, color_Easing);
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
        }
Beispiel #3
0
        public static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve,
            Data.Value.Gradient gradient = null)
        {
            var colorType = color.Value;

            if ((colorType == StandardColorType.FCurve && color_FCurve == null) ||
                (colorType == StandardColorType.Gradient && gradient == null))
            {
                colorType = StandardColorType.Fixed;
            }

            data.Add(((int)colorType).GetBytes());

            if (colorType == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                AddColorEasing(data, color_Easing);
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
            else if (color.Value == Data.StandardColorType.Gradient)
            {
                var bytes = gradient.ToBinary();
                data.Add(bytes);
            }
        }
Beispiel #4
0
        public void SetBinding(object o)
        {
            var o_ = o as Data.Value.Color;

            Binding = o_;
        }
Beispiel #5
0
 void ColorCtrl_HandleDestroyed(object sender, EventArgs e)
 {
     Binding = null;
 }