public override bool Draw() { base.Draw(); DisplayNameText.Position = OffsetVector(ColorBarNative.TopLeft, 0, -22); DisplayNameText.Draw(); //Color Display Bar DrawRectangle(ColorBarNative, DefaultColorGold, 2, false); Line.DrawLine(CurrentValue, ColorBarNative.Height - 2, SetVector(ColorBarNative.TopLeft, ColorBarNative.TopLeft.X + 1, ColorBarNative.Center.Y), SetVector(ColorBarNative.TopRight, ColorBarNative.Right, ColorBarNative.Center.Y)); //Red DrawColorBar(RedBarNative, color => Color.FromArgb(color, Green, Blue)); DrawRectangle(RedBarNative, DefaultColorGold, 2f); DrawColorPointer(RedBarNative, Red); RedText.TextValue = "Red: " + Red; RedText.Position = OffsetVector(RedBarNative.BottomRight, -50, _barPadding[3]); RedText.Draw(); //Green DrawColorBar(GreenBarNative, color => Color.FromArgb(Red, color, Blue)); DrawRectangle(GreenBarNative, DefaultColorGold, 2); DrawColorPointer(GreenBarNative, Green); GreenText.TextValue = "Green: " + Green; GreenText.Position = OffsetVector(GreenBarNative.BottomRight, -60, _barPadding[3]); GreenText.Draw(); //Blue DrawColorBar(BlueBarNative, color => Color.FromArgb(Red, Green, color)); DrawRectangle(BlueBarNative, DefaultColorGold, 2); DrawColorPointer(BlueBarNative, Blue); BlueText.TextValue = "Blue: " + Blue; BlueText.Position = OffsetVector(BlueBarNative.BottomRight, -50, _barPadding[3]); BlueText.Draw(); //Alpha DrawColorBar(AlphaBarNative, color => Color.FromArgb(color, color, color)); DrawRectangle(AlphaBarNative, DefaultColorGold, 2); DrawColorPointer(AlphaBarNative, Alpha); AlphaText.TextValue = "Alpha: " + Alpha; AlphaText.Position = OffsetVector(AlphaBarNative.BottomRight, -60, _barPadding[3]); AlphaText.Draw(); return(true); }
private void AddGenericEvents(ColorAnimation colorAnimation) { KeyDown += (_, e) => Shortcuts.GenericWindowShortcuts.KeysDown(null, e, this); // CloseButton CloseButton.TheButton.Click += delegate { Hide(); }; // MinButton MinButton.TheButton.Click += delegate { SystemCommands.MinimizeWindow(this); }; TitleBar.MouseLeftButtonDown += delegate { DragMove(); }; // BlueRadio BlueRadio.PreviewMouseLeftButtonDown += BlueRadio_PreviewMouseLeftButtonDown; BlueRadio.MouseEnter += BlueRadio_MouseEnter; BlueRadio.MouseLeave += BlueRadio_MouseLeave; BlueRadio.Click += Blue; // PinkRadio PinkRadio.PreviewMouseLeftButtonDown += PinkRadio_PreviewMouseLeftButtonDown; PinkRadio.MouseEnter += PinkRadio_MouseEnter; PinkRadio.MouseLeave += PinkRadio_MouseLeave; PinkRadio.Click += Pink; // OrangeRadio OrangeRadio.PreviewMouseLeftButtonDown += OrangeRadio_PreviewMouseLeftButtonDown; OrangeRadio.MouseEnter += OrangeRadio_MouseEnter; OrangeRadio.MouseLeave += OrangeRadio_MouseLeave; OrangeRadio.Click += Orange; // GreenRadio GreenRadio.PreviewMouseLeftButtonDown += GreenRadio_PreviewMouseLeftButtonDown; GreenRadio.MouseEnter += GreenRadio_MouseEnter; GreenRadio.MouseLeave += GreenRadio_MouseLeave; GreenRadio.Click += Green; // RedRadio RedRadio.PreviewMouseLeftButtonDown += RedRadio_PreviewMouseLeftButtonDown; RedRadio.MouseEnter += RedRadio_MouseEnter; RedRadio.MouseLeave += RedRadio_MouseLeave; RedRadio.Click += Red; // TealRadio TealRadio.PreviewMouseLeftButtonDown += TealRadio_PreviewMouseLeftButtonDown; TealRadio.MouseEnter += TealRadio_MouseEnter; TealRadio.MouseLeave += TealRadio_MouseLeave; TealRadio.Click += Teal; // AquaRadio AquaRadio.PreviewMouseLeftButtonDown += AquaRadio_PreviewMouseLeftButtonDown; AquaRadio.MouseEnter += AquaRadio_MouseEnter; AquaRadio.MouseLeave += AquaRadio_MouseLeave; AquaRadio.Click += Aqua; // GoldenRadio GoldenRadio.PreviewMouseLeftButtonDown += GoldenRadio_PreviewMouseLeftButtonDown; GoldenRadio.MouseEnter += GoldenRadio_MouseEnter; GoldenRadio.MouseLeave += GoldenRadio_MouseLeave; GoldenRadio.Click += Golden; // PurpleRadio PurpleRadio.PreviewMouseLeftButtonDown += PurpleRadio_PreviewMouseLeftButtonDown; PurpleRadio.MouseEnter += PurpleRadio_MouseEnter; PurpleRadio.MouseLeave += PurpleRadio_MouseLeave; PurpleRadio.Click += Purple; // CyanRadio CyanRadio.PreviewMouseLeftButtonDown += CyanRadio_PreviewMouseLeftButtonDown; CyanRadio.MouseEnter += CyanRadio_MouseEnter; CyanRadio.MouseLeave += CyanRadio_MouseLeave; CyanRadio.Click += Cyan; // MagentaRadio MagentaRadio.PreviewMouseLeftButtonDown += MagentaRadio_PreviewMouseLeftButtonDown; MagentaRadio.MouseEnter += MagentaRadio_MouseEnter; MagentaRadio.MouseLeave += MagentaRadio_MouseLeave; MagentaRadio.Click += Magenta; // LimeRadio LimeRadio.Click += Lime; LimeRadio.PreviewMouseLeftButtonDown += LimeRadio_PreviewMouseLeftButtonDown; LimeRadio.MouseEnter += LimeRadio_MouseEnter; LimeRadio.MouseLeave += Lime_MouseLeave; // WallpaperApply WallpaperApply.MouseEnter += delegate { colorAnimation.From = AnimationHelper.GetPrefferedColorOver(); colorAnimation.To = AnimationHelper.GetPrefferedColorDown(); WallpaperApplyBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; WallpaperApply.MouseLeave += delegate { colorAnimation.From = AnimationHelper.GetPrefferedColorDown(); colorAnimation.To = AnimationHelper.GetPrefferedColorOver(); WallpaperApplyBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; // DarkThemeRadio DarkThemeRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(DarkThemeText); }; DarkThemeRadio.MouseEnter += delegate { ButtonMouseOverAnim(DarkThemeText); }; DarkThemeRadio.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(DarkThemeBrush); }; DarkThemeRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(DarkThemeText); }; DarkThemeRadio.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(DarkThemeBrush); }; // LightThemeRadio LightThemeRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(LightThemeText); }; LightThemeRadio.MouseEnter += delegate { ButtonMouseOverAnim(LightThemeText); }; LightThemeRadio.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(LightThemeBrush); }; LightThemeRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(LightThemeText); }; LightThemeRadio.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(LightThemeBrush); }; // SubDirRadio SubDirRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(SubDirText); }; SubDirRadio.MouseEnter += delegate { ButtonMouseOverAnim(SubDirText); }; SubDirRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(SubDirText); }; // TopmostRadio TopmostRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(TopMostDirText); }; TopmostRadio.MouseEnter += delegate { ButtonMouseOverAnim(TopMostDirText); }; TopmostRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(TopMostDirText); }; // CenterRadio CenterRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(CenterubDirText); }; CenterRadio.MouseEnter += delegate { ButtonMouseOverAnim(CenterubDirText); }; CenterRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(CenterubDirText); }; // BorderRadio BorderRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(BorderBrushText); }; BorderRadio.MouseEnter += delegate { ButtonMouseOverAnim(BorderBrushText); }; BorderRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(BorderBrushText); }; // AltUIRadio AltUIRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(AltUIText); }; AltUIRadio.MouseEnter += delegate { ButtonMouseOverAnim(AltUIText); }; AltUIRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(AltUIText); }; // Restart RestartButton.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(RestartText); }; RestartButton.MouseEnter += delegate { ButtonMouseOverAnim(RestartText); }; RestartButton.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(RestartBrush); }; RestartButton.MouseLeave += delegate { ButtonMouseLeaveAnim(RestartText); }; RestartButton.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(RestartBrush); }; if (!Properties.Settings.Default.DarkTheme) { BlueRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; BlueText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; BlueRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); BlueText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; CyanRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; CyanText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; CyanRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); CyanText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; AquaRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; AquaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; AquaRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); AquaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; TealRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; TealText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; TealRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); TealText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; LimeRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; LimeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; LimeRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); LimeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; GreenRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; GreenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; GreenRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); GreenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; GoldenRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; GoldenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; GoldenRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); GoldenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; OrangeRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; OrangeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; OrangeRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); OrangeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; RedRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; RedText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; RedRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); RedText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; PinkRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; PinkText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; PinkRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); PinkText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; MagentaRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; MagentaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; MagentaRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); MagentaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; PurpleRadio.MouseEnter += delegate { colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); colorAnimation.To = Colors.White; PurpleText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; PurpleRadio.MouseLeave += delegate { colorAnimation.From = Colors.White; colorAnimation.To = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B); PurpleText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation); }; } }