Exemple #1
0
        public bool CopyFrom(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var from = obj as DataMeshPlotStyle;

            if (null == from)
            {
                return(false);
            }

            using (var suspendToken = SuspendGetToken())
            {
                _clipToLayer   = from._clipToLayer;
                _colorProvider = from._colorProvider;
                ChildCloneToMember(ref _colorScale, from._colorScale);
                _material = from._material; // Material is immutable

                EhSelfChanged();
                suspendToken.Resume();
            }
            return(true);
        }
Exemple #2
0
 /// <summary>
 /// Setups the color provider.
 /// </summary>
 protected virtual void SetupColorProvider()
 {
     if (m_ColorProvider == null)
     {
         m_ColorProvider = new PlayerColorProvider();
     }
 }
Exemple #3
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
            });
        }
        public bool CopyFrom(object obj, bool copyWithDataReferences)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            var from = obj as ColumnDrivenColorPlotStyle;

            if (null != from)
            {
                using (var suspendToken = SuspendGetToken())
                {
                    _appliesToFill       = from._appliesToFill;
                    _appliesToStroke     = from._appliesToStroke;
                    _appliesToBackground = from._appliesToBackground;
                    InternalSetScale(null == from._scale ? null : (NumericalScale)from._scale.Clone());
                    _colorProvider = from._colorProvider;

                    if (copyWithDataReferences)
                    {
                        InternalSetDataColumnProxy(null == from._dataColumnProxy ? null : (IReadableColumnProxy)from._dataColumnProxy.Clone());
                    }

                    //_parent = from._parent;

                    suspendToken.ResumeSilently();
                }
                EhSelfChanged(EventArgs.Empty);
                return(true);
            }
            return(false);
        }
Exemple #5
0
 public CloudDrawer(ICloudLayouter cloudLayouter, IColorProvider colorProvider, IImageSaver imageSaver)
 {
     this.cloudLayouter = cloudLayouter;
     ChangeImageSize(300);
     cloudLayouter.ChangeCenter(new Point(ImageSize / 2, ImageSize / 2));
     ImageSaver    = imageSaver;
     ColorProvider = colorProvider;
 }
 private void Awake()
 {
     alchemyTool = this.GetComponent <IColorProvider>();
     if (alchemyTool == null || sr == null)
     {
         this.enabled = false;
     }
 }
Exemple #7
0
        private void LazyLoadColorProvider()
        {
            if (_colorProvider != null)
            {
                return;
            }

            _colorProvider = new TeamColorProvider();
        }
Exemple #8
0
        public void Prepare()
        {
            var colorMock = new Mock <IColorProvider>();

            colorMock.Setup(x => x.GetColor(true)).Returns("R");
            colorMock.Setup(x => x.GetColor(false)).Returns("O");

            _redColorProvider = colorMock.Object;
        }
Exemple #9
0
 public Renderer(ICameraPositionProvider positionProvider, ICameraDirectionProvider directionProvider,
                 IScreenProvider screenProvider, IColorProvider colorProvider, ILightsProvider lightsProvider)
 {
     _positionProvider  = positionProvider;
     _directionProvider = directionProvider;
     _screenProvider    = screenProvider;
     _colorProvider     = colorProvider;
     _lightsProvider    = lightsProvider;
 }
Exemple #10
0
        public void Prepare()
        {
            var colorMock2 = new Mock <IColorProvider>();

            colorMock2.Setup(x => x.GetColor(true)).Returns("Y");
            colorMock2.Setup(x => x.GetColor(false)).Returns("O");

            _yellowColorProvider = colorMock2.Object;
        }
 public CurveEffect(
     NeoPixelSetup neoPixelSetup,
     IColorProvider colorProvider,
     IInterpolation interpolator)
 {
     this.neoPixelSetup = neoPixelSetup;
     this.ColorProvider = colorProvider;
     this.Interpolator  = interpolator;
 }
Exemple #12
0
        public Form1()
        {
            _arduinoConnection = new ArduinoConnection();
            _colorProvider = new DirectxColorProvider();

            InitializeComponent();

            _arduinoConnection.Initialize();
        }
Exemple #13
0
		public override bool Equals(IColorProvider other)
		{
			if (!base.Equals(other))
				return false;

			var from = (VisibleLightSpectrum)other;

			return
				this._gamma == from._gamma &&
				this._brightness == from._brightness;
		}
 public PulseEffect(
     NeoPixelSetup neoPixelSetup,
     int skipPixels,
     int numberOfPixels,
     IColorProvider colorProvider,
     float speed)
 {
     this.neoPixelSetup     = neoPixelSetup;
     this.AreaStartPosition = skipPixels;
     this.ColorProvider     = colorProvider;
     this.AreaLength        = numberOfPixels;
     this.Speed             = speed;
 }
Exemple #15
0
        public override bool Equals(IColorProvider other)
        {
            if (!base.Equals(other))
            {
                return(false);
            }

            var from = (VisibleLightSpectrum)other;

            return
                (_gamma == from._gamma &&
                 _brightness == from._brightness);
        }
        private void OnChangeColorExecute(object parameter)
        {
            var parameterValues = (object[])parameter;

            var currentButton = parameterValues[0];
            var colorProvider = (IColorProvider)parameterValues[1];

            _currentColorProvider  = colorProvider;
            _popup.PlacementTarget = (Button)currentButton;

            _previousColor   = EditingColor = colorProvider.Color;
            IsColorSelecting = true;
        }
        public CairoBoard(ArrayList pos)
            : base()
        {
            //figure = new Figure ();
            fm = new FigureManager ();
            position = new Position (pos);
            info = new MoveInfo ();

            layout = new Pango.Layout (PangoContext);
            if (Config.WindowsBuild)
                colors = new CustomColorProvider ();
            else
                colors = new GtkBasedColorProvider (this);
        }
Exemple #18
0
        public VisualSettings(IConfig currentConfig, IColorProvider colorProvider, ILanguageProvider languageProvider)
        {
            ColorProvider = colorProvider;

            AvailableAccentColors = new List <ColorItem>(ColorProvider.AvailableAccentColors.Select(a =>
                                                                                                    new ColorItem
            {
                Name       = a.Name,
                ColorBrush = new SolidColorBrush(a.ExemplarHue.Color)
            }
                                                                                                    ));

            AvailablePrimaryColors = new List <ColorItem>(ColorProvider.AvailablePrimaryColors.Select(a =>
                                                                                                      new ColorItem
            {
                Name       = a.Name,
                ColorBrush = new SolidColorBrush(a.ExemplarHue.Color)
            }
                                                                                                      ));

            SelectedPrimaryColor = AvailablePrimaryColors.FirstOrDefault(c => c.Name == currentConfig.Visual.PrimaryColor);
            SelectedAccentColor  = AvailableAccentColors.FirstOrDefault(c => c.Name == currentConfig.Visual.AccentColor);

            AvailableFontSizes = new List <FontSizeItem>();
            foreach (var kvp in new Dictionary <int, string>
            {
                { 10, "Tiny" },
                { 13, "Small" },
                { 16, "Normal" },
                { 18, "Large" },
                { 20, "Huge" }
            })
            {
                string name = Strings.ResourceManager.GetString($"FontSize_{kvp.Value}", languageProvider.CurrentCulture);
                AvailableFontSizes.Add(new FontSizeItem
                {
                    DisplayName = name,
                    Size        = kvp.Key
                });
            }

            UseDarkTheme         = currentConfig.Visual.UseDarkTheme;
            SelectedFontSize     = AvailableFontSizes.FirstOrDefault(f => f.Size == currentConfig.Visual.FontSize);
            SelectedHashtagColor = AvailableAccentColors.FirstOrDefault(c => c.Name == currentConfig.Visual.HashtagColor);
            SelectedLinkColor    = AvailableAccentColors.FirstOrDefault(c => c.Name == currentConfig.Visual.LinkColor);
            SelectedMentionColor = AvailableAccentColors.FirstOrDefault(c => c.Name == currentConfig.Visual.MentionColor);
            InlineMedias         = currentConfig.Visual.InlineMedia;

            PreviewStatuses = new List <StatusViewModel>();
        }
        private void LazyLoadColorProvider()
        {
            if (m_ColorProvider != null)
            {
                return;
            }

            if (true)
            {
                Debug.Log("Missing mode - assigning PlayerColorProvider by default");
                m_ColorProvider = new PlayerColorProvider();
                return;
            }
        }
Exemple #20
0
        public virtual bool Equals(IColorProvider other)
        {
            if (null == other || other.GetType() != GetType())
            {
                return(false);
            }

            var from = (ColorProviderBase)other;

            return
                (_colorBelow == from._colorBelow &&
                 _colorAbove == from._colorAbove &&
                 _colorInvalid == from._colorInvalid &&
                 _alphaChannel == from._alphaChannel &&
                 _colorSteps == from._colorSteps);
        }
Exemple #21
0
        public IGeometry RegenerateMesh()
        {
            IColorProvider provider = meshColorProvider;

            switch (WorldColor)
            {
            case WorldColorE.PlateColor:
                provider = meshColorProvider;
                break;

            case WorldColorE.Height:
                provider = heightColorProvider;
                break;
            }
            return(geometry.GenerateDual <Vertex3DColorUV>(provider));
        }
Exemple #22
0
        private void LazyLoadColorProvider()
        {
            if (m_ColorProvider != null)
            {
                return;
            }

            if (m_Settings.mode == null)
            {
                Debug.Log("Missing mode - assigning PlayerColorProvider by default");
                m_ColorProvider = new PlayerColorProvider();
                return;
            }

            m_ColorProvider = m_Settings.mode.rulesProcessor.GetColorProvider();
        }
		public override bool Equals(IColorProvider other)
		{
			if (!base.Equals(other))
				return false;

			var from = (ColorProviderAHSBGradient)other;

			return
				this._alpha0 == from._alpha0 &&
				this._alpha1 == from._alpha1 &&
				this._hue0 == from._hue0 &&
				this._hue1 == from._hue1 &&
				this._saturation0 == from._saturation0 &&
				this._saturation1 == from._saturation1 &&
				this._brightness0 == from._brightness0 &&
				this._brightness1 == from._brightness1;
		}
        public override bool Equals(IColorProvider other)
        {
            if (!base.Equals(other))
            {
                return(false);
            }

            var from = (ColorProviderARGBGradient)other;

            return
                (_alpha0 == from._alpha0 &&
                 _alpha1 == from._alpha1 &&
                 _red0 == from._red0 &&
                 _red1 == from._red1 &&
                 _green0 == from._green0 &&
                 _green1 == from._green1 &&
                 _blue0 == from._blue0 &&
                 _blue1 == from._blue1);
        }
        public override bool Equals(IColorProvider other)
        {
            if (!base.Equals(other))
            {
                return(false);
            }

            var from = (ColorProviderAHSBGradient)other;

            return
                (_alpha0 == from._alpha0 &&
                 _alpha1 == from._alpha1 &&
                 _hue0 == from._hue0 &&
                 _hue1 == from._hue1 &&
                 _saturation0 == from._saturation0 &&
                 _saturation1 == from._saturation1 &&
                 _brightness0 == from._brightness0 &&
                 _brightness1 == from._brightness1);
        }
        public GameControl(IGlyphProvider <TGlyph> glyphProvider, IColorProvider <TColor> colorProvider, int heightInGlyphs,
                           int widthInGlyphs)
        {
            _glyphProvider  = glyphProvider;
            _colorProvider  = colorProvider;
            _heightInGlyphs = heightInGlyphs;
            _widthInGlyphs  = widthInGlyphs;

            Controls.Add(CreateMainMenu());
            Controls.Add(CreateGame());
            Controls.Add(CreateLocalMenu());
            Controls.Add(CreateSaveMenu());
            Controls.Add(CreateLoadMenu());

            OnPageChanged += (pages, args) =>
            {
                _previousPage = args.OldValue;
            };
        }
		public override bool Equals(IColorProvider other)
		{
			if (!base.Equals(other))
				return false;

			var from = (ColorProviderARGBGradient)other;

			return
				this._alpha0 == from._alpha0 &&
				this._alpha1 == from._alpha1 &&
				this._red0 == from._red0 &&
				this._red1 == from._red1 &&
				this._green0 == from._green0 &&
				this._green1 == from._green1 &&
				this._blue0 == from._blue0 &&
				this._blue1 == from._blue1;
		}
 public OperationsController(ICalculator calculator, IColorProvider colorProvider)
 {
     this.calculator    = calculator;
     this.colorProvider = colorProvider;
 }
Exemple #29
0
 public LevelControl(IGlyphProvider <TGlyph> glyphProvider, IColorProvider <TColor> colorProvider)
 {
     _glyphProvider = glyphProvider;
     _colorProvider = colorProvider;
 }
 /// <summary>
 /// Creates a new instance with default values.
 /// </summary>
 public ColumnDrivenColorPlotStyle()
 {
     InternalSetScale(new LinearScale());
     InternalSetDataColumnProxy(NumericColumnProxyBase.FromColumn(new Altaxo.Data.EquallySpacedColumn(0, 0.25)));
     _colorProvider = new ColorProvider.VisibleLightSpectrum();
 }
Exemple #31
0
 public SecondFormatter(IColorProvider colorProvider)
 {
     _colorProvider = colorProvider;
 }
Exemple #32
0
		public virtual bool Equals(IColorProvider other)
		{
			if (null == other || other.GetType() != this.GetType())
				return false;

			var from = (ColorProviderBase)other;

			return
				_colorBelow == from._colorBelow &&
				_colorAbove == from._colorAbove &&
				_colorInvalid == from._colorInvalid &&
				_alphaChannel == from._alphaChannel &&
				_colorSteps == from._colorSteps;
		}
		/// <summary>
		/// Creates a new instance with default values.
		/// </summary>
		public ColumnDrivenColorPlotStyle()
		{
			InternalSetScale(new LinearScale());
			InternalSetDataColumnProxy(NumericColumnProxyBase.FromColumn(new Altaxo.Data.EquallySpacedColumn(0, 0.25)));
			_colorProvider = new ColorProvider.VisibleLightSpectrum();
		}
		public abstract IPositionNormalUIndexedTriangleBuffer GetPositionNormalUIndexedTriangleBuffer(IMaterial material, PlaneD3D[] clipPlanes, IColorProvider colorProvider);
Exemple #35
0
 public ColorSelectorViewModel(IColorProvider colorProvider, IColorThemeService colorThemeService)
 {
     _colorThemeService = colorThemeService;
     Colors             = colorProvider.ColorThemes;
 }
Exemple #36
0
		public bool CopyFrom(object obj)
		{
			if (object.ReferenceEquals(this, obj))
				return true;

			var from = obj as DataMeshPlotStyle;
			if (null == from)
				return false;

			using (var suspendToken = SuspendGetToken())
			{
				this._clipToLayer = from._clipToLayer;
				_colorProvider = from._colorProvider;
				ChildCloneToMember(ref _colorScale, from._colorScale);
				this._material = from._material; // Material is immutable

				EhSelfChanged();
				suspendToken.Resume();
			}
			return true;
		}
Exemple #37
0
 public Fetch(IColorProvider colorProvider)
 {
   _colorProvider = colorProvider
 }
 public HourFormatter(IColorProvider colorProvider)
 {
     _colorProvider = colorProvider;
 }
		public bool CopyFrom(object obj, bool copyWithDataReferences)
		{
			if (object.ReferenceEquals(this, obj))
				return true;

			var from = obj as ColumnDrivenColorPlotStyle;
			if (null != from)
			{
				using (var suspendToken = SuspendGetToken())
				{
					_appliesToFill = from._appliesToFill;
					_appliesToStroke = from._appliesToStroke;
					_appliesToBackground = from._appliesToBackground;
					InternalSetScale(null == from._scale ? null : (NumericalScale)from._scale.Clone());
					_colorProvider = from._colorProvider;

					if (copyWithDataReferences)
					{
						InternalSetDataColumnProxy(null == from._dataColumnProxy ? null : (IReadableColumnProxy)from._dataColumnProxy.Clone());
					}

					//_parent = from._parent;

					suspendToken.ResumeSilently();
				}
				EhSelfChanged(EventArgs.Empty);
				return true;
			}
			return false;
		}
 public StroopTestController(ISessionStorage sessionStorage, IColorProvider colorProvider, StroopTestSettings settings)
 {
     _sessionStorage = sessionStorage;
     _colorProvider  = colorProvider;
     _settings       = settings;
 }