public static IColorReturnable[] GetWith(IColorReturnable add)
 {
     if (add is My2DClassicColorMode) return new IColorReturnable[] {add,new Simple2DFractalColorMode(),new SimpleInverse2DFractalColorMode()};
     if (add is Simple2DFractalColorMode) return new IColorReturnable[] {new My2DClassicColorMode() ,add,new SimpleInverse2DFractalColorMode()};
     if (add is SimpleInverse2DFractalColorMode) return new IColorReturnable[] {new My2DClassicColorMode(),new Simple2DFractalColorMode(),add};
     return new IColorReturnable[] {new My2DClassicColorMode(),new Simple2DFractalColorMode(),new SimpleInverse2DFractalColorMode(),add };
 }
 public CycleGradientColorMode(int[] Percents,Color[] Colors,Color ColorOfVoid,ulong GradientIterationsCount,ulong GradientVoidIterationsCount)
 {
     _percents = Percents;
     _color = Colors;
     _gradient_void = ColorOfVoid;
     _gradient_iterations_count = GradientIterationsCount;
     _gradient_void_iterations_count = GradientVoidIterationsCount;
     _using_mod = new VoidColorMode(this);
     _using_color_modes = WeAreColorReturnable.GetWith(_using_mod);
 }
 public CycleGradientColorMode()
 {
     _percents = new int[] { 0, 180, 360 };
     _color = new Color[] {Color.Black,Color.White,Color.Black};
     _gradient_void = Color.Silver;
     _gradient_iterations_count = 70;
     _gradient_void_iterations_count = 20;
     _using_mod = new VoidColorMode(this);
     _using_color_modes = WeAreColorReturnable.GetWith(_using_mod);
 }
        private void Processor(object Value, int ui, Control sender)
        {
            switch (ui)
            {
            case 0: {
                _gradient_iterations_count = (ulong)((int)Value);
                break;
            }

            case 1:
            {
                _gradient_void_iterations_count = (ulong)((int)Value);
                break;
            }

            case 2:
            {
                ColorGradientEventArgs ee = (ColorGradientEventArgs)Value;
                _percents = ee.Positions.Select(arg => (int)(arg * 360)).ToArray();
                _color    = ee.Colors;
                if (spec_mode)
                {
                    int swap = _percents[1];
                    _percents[1] = _percents.Last();
                    _percents[_percents.Length - 1] = swap;
                    Color sw = _color[1];
                    _color[1] = _color.Last();
                    _color[_color.Length - 1] = sw;
                }
                //_percents[1] = 360;
                break;
            }

            case 10:
            {
                _using_mod = (IColorReturnable)(_using_color_modes[(int)Value]);
                _unique_subinterface.Controls.Clear();
                if (_using_mod is FractalColorMode)
                {
                    _unique_subinterface.Controls.Add(((FractalColorMode)_using_mod).GetUniqueInterface(_unique_subinterface.Width, _unique_subinterface.Height));
                }
                break;
            }
            }
            _fcm_on_FractalColorModeChangedHandler();
        }
        public CycleGradientColorMode(int[] Percents,Color[] Colors,Color ColorOfVoid,ulong GradientIterationsCount,ulong GradientVoidIterationsCount,IColorReturnable UsingMod)
        {
            _percents = Percents;
            _color = Colors;
            _gradient_void = ColorOfVoid;
            _gradient_iterations_count = GradientIterationsCount;
            _gradient_void_iterations_count = GradientVoidIterationsCount;
            _using_color_modes = WeAreColorReturnable.GetWith(new VoidColorMode(this));
            _using_mod = UsingMod;
            for (int i = 0; i < _using_color_modes.Length - 1; i++)
            {

                if (_using_color_modes[i].GetType().Equals(UsingMod.GetType()))
                {
                    _using_color_modes[i] = UsingMod;
                }
                if (_using_color_modes[i] is FractalColorMode)
                    ((FractalColorMode)_using_color_modes[i]).FractalColorModeChanged += (fcm, control) => { this._fcm_on_FractalColorModeChangedHandler(); };
            }
        }
예제 #6
0
        public static IColorReturnable[] GetWith(IColorReturnable add)
        {
            if (add is My2DClassicColorMode)
            {
                return new IColorReturnable[] { add, new Simple2DFractalColorMode(), new SimpleInverse2DFractalColorMode() }
            }
            ;
            if (add is Simple2DFractalColorMode)
            {
                return new IColorReturnable[] { new My2DClassicColorMode(), add, new SimpleInverse2DFractalColorMode() }
            }
            ;
            if (add is SimpleInverse2DFractalColorMode)
            {
                return new IColorReturnable[] { new My2DClassicColorMode(), new Simple2DFractalColorMode(), add }
            }
            ;
            return(new IColorReturnable[] { new My2DClassicColorMode(), new Simple2DFractalColorMode(), new SimpleInverse2DFractalColorMode(), add });
        }
    }
}
 public CycleGradientColorMode(int[] Percents, Color[] Colors, Color ColorOfVoid, ulong GradientIterationsCount, ulong GradientVoidIterationsCount, IColorReturnable UsingMod)
 {
     _percents                       = Percents;
     _color                          = Colors;
     _gradient_void                  = ColorOfVoid;
     _gradient_iterations_count      = GradientIterationsCount;
     _gradient_void_iterations_count = GradientVoidIterationsCount;
     _using_color_modes              = WeAreColorReturnable.GetWith(new VoidColorMode(this));
     _using_mod                      = UsingMod;
     for (int i = 0; i < _using_color_modes.Length - 1; i++)
     {
         if (_using_color_modes[i].GetType().Equals(UsingMod.GetType()))
         {
             _using_color_modes[i] = UsingMod;
         }
         if (_using_color_modes[i] is FractalColorMode)
         {
             ((FractalColorMode)_using_color_modes[i]).FractalColorModeChanged += (fcm, control) => { this._fcm_on_FractalColorModeChangedHandler(); }
         }
         ;
     }
 }
        private void Processor(object Value,int ui, Control sender)
        {
            switch(ui)
            {
                case 0: {
                    _gradient_iterations_count = (ulong)((int)Value);
                    break;
                }
                case 1:
                    {
                        _gradient_void_iterations_count = (ulong)((int)Value);
                        break;
                    }
                case 2:
                    {
                        ColorGradientEventArgs ee = (ColorGradientEventArgs)Value;
                        _percents = ee.Positions.Select(arg => (int)(arg * 360)).ToArray();
                        _color = ee.Colors;
                        if (spec_mode)
                        {
                            int swap = _percents[1];
                            _percents[1] = _percents.Last();
                            _percents[_percents.Length - 1] = swap;
                            Color sw = _color[1];
                            _color[1] = _color.Last();
                            _color[_color.Length - 1] = sw;
                        }
                        //_percents[1] = 360;
                        break;
                    }
                case 10:
                    {
                        _using_mod = (IColorReturnable)(_using_color_modes[(int)Value]);
                        _unique_subinterface.Controls.Clear();
                        if(_using_mod is FractalColorMode)_unique_subinterface.Controls.Add(((FractalColorMode)_using_mod).GetUniqueInterface(_unique_subinterface.Width,_unique_subinterface.Height));
                        break;
                    }

            }
            _fcm_on_FractalColorModeChangedHandler();
        }