public GradientModel(GradientPackModel pack)
        {
            var length = pack.Values.Length;

            StartColor = pack.Colors[0];
            EndColor   = pack.Colors[length - 1];
            InitArrays();
            for (var i = 0; i < length - 2; i++)
            {
                Add(GiveIdModel.Get, pack.Colors[i + 1], pack.Values[i + 1]);
            }
        }
        public GradientPackModel Pack()
        {
            var packLength = Length + 2;
            var pack       = new GradientPackModel
            {
                Colors = new Color[packLength],
                Values = new double[packLength]
            };

            pack.Colors[0] = StartColor;
            pack.Colors[packLength - 1] = EndColor;
            pack.Values[0] = 0.0;
            pack.Values[packLength - 1] = 1.0;
            for (var i = 0; i < Length; i++)
            {
                pack.Colors[i + 1] = Colors[i];
                pack.Values[i + 1] = Values[i];
            }

            return(pack);
        }