public static FColor GetFColor(this XColorVM _xc) { if (_xc == null) { return(FColor.White); } return(new FColor(_xc.A, _xc.R, _xc.G, _xc.B)); }
public XTileInfoVM() { Color = new XColorVM(); Color.BindProps(); Color.SetDispatcher(Manager.Instance.Dispatcher); Color.Set(m_color.Value.GetFColor()); Color.PropertyChanged += (_sender, _args) => RefreshImage(); DublicateCommand = new RelayCommand(ExecuteDublicateCommand); DeleteCommand = new RelayCommand(ExecuteDeleteCommand, _o => Parent.Children.Count > 1); MoveLeftCommand = new RelayCommand(ExecuteMoveLeftCommand, _o => Parent.Children.Any(_vm => _vm.Order < Order)); MoveRightCommand = new RelayCommand(ExecuteMoveRightCommand, _o => Parent.Children.Any(_vm => _vm.Order > Order)); RefreshMosaicCommand = new RelayCommand(_o => Parent.UpdateMosaic()); CopyCommand = new RelayCommand(_o => Manager.Instance.TileBuffer = this); PasteCommand = new RelayCommand(ExecutePasteCommand, _o => Manager.Instance.TileBuffer != null); AlignColorsCommand = new RelayCommand(ExecuteAlignColorsCommand); NoiseColorsCommand = new RelayCommand(ExecuteNoiseColorsCommand); }
public static System.Windows.Media.Color GetColor(this XColorVM _xc) { return(GetColor(_xc.GetFColor())); }
public static System.Drawing.Color GetDColor(this XColorVM _xc) { return(System.Drawing.Color.FromArgb((byte)(_xc.A * 255), (byte)(_xc.R * 255), (byte)(_xc.G * 255), (byte)(_xc.B * 255))); }