Beispiel #1
0
        public CurveEffect CreateDefaultCurveEffect(
            string name,
            bool isEnabled,
            IColorProvider colorProvider,
            int areaStartPosition,
            int areaLength,
            int effectLength,
            float speed,
            float intensity = 1)
        {
            Curve curve = new Curve();

            curve.AddPoint(0, 0, 0);
            curve.AddPoint(0.2, 1, 0);
            curve.AddPoint(1, 0, 0);
            var interpolator = CubicSpline.InterpolateHermite(curve.X.ToArray(), curve.Y.ToArray(), curve.W.ToArray());

            return(new CurveEffect(neoPixelSetup, colorProvider, interpolator)
            {
                Name = name,
                IsEnabled = isEnabled,
                AreaStartPosition = areaStartPosition,
                AreaLength = areaLength,
                EffectLength = effectLength,
                Speed = speed,
                Intensity = intensity
            });
        }