Exemplo n.º 1
0
		//private SolidColorBrush _brush;
		#endregion


		#region Constructor

		public ColorVM(ColorVM source)
		{
			//_red = 0.0f;
			//_green = 0.0f;
			//_blue = 0.0f;
			//_alpha = 1.0f;
			_rgba = new Vector4(source.Red, source.Green, source.Blue, source.Alpha);
			updateHSV();
			Red = _rgba.X;
			Green = _rgba.Y;
			Blue = _rgba.Z;
			Alpha = _rgba.W;
			//_brush = new SolidColorBrush(new System.Windows.Media.Color()
			//{
			//	R = (byte)(_rgba.X * 255.0f),
			//	G = (byte)(_rgba.Y * 255.0f),
			//	B = (byte)(_rgba.Z * 255.0f),
			//	A = (byte)(_rgba.W * 255.0f)
			//});
			updateBrush();
		}
Exemplo n.º 2
0
		private static void OnBrushChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			ColorVM colorCanvas = o as ColorVM;
			if (colorCanvas != null)
				colorCanvas.OnBrushChanged((SolidColorBrush)e.OldValue, (SolidColorBrush)e.NewValue);
		}
Exemplo n.º 3
0
		private static void OnAlphaChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			ColorVM colorCanvas = o as ColorVM;
			if (colorCanvas != null)
				colorCanvas.OnAlphaChanged((float)e.OldValue, (float)e.NewValue);
		}