Source/ColorFunctions.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace DevComponents.DotNetBar
{
    using System;
	using System.Drawing;

    /// <summary>
    ///    Summary description for ColorFunctions.
    /// </summary>
    public class ColorFunctions
    {
		private static Color m_HoverBackColor;
		private static Color m_HoverBackColor2;
		private static Color m_HoverBackColor3;
		private static Color m_CheckBoxBackColor;
		private static Color m_MenuBackColor;
		private static Color m_MenuFocusBorderColor;
		private static Color m_PressedBackColor;
		private static Color m_ToolMenuFocusBackColor;
		private static Color m_SideRecentlyBackColor;
		private static Color m_RecentlyUsedOfficeBackColor;

		private static Bitmap m_PushedBrushBmp=null;

		internal static bool ColorsLoaded=false;

		public static void LoadColors()
		{
			RefreshColors();
			if(!ColorsLoaded)
				Microsoft.Win32.SystemEvents.UserPreferenceChanged+=new Microsoft.Win32.UserPreferenceChangedEventHandler(ColorFunctions.PreferenceChanged);
			ColorsLoaded=true;
		}

		private static void PreferenceChanged(object sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
		{
			RefreshColors();
			NativeFunctions.RefreshSettings();
			BarFunctions.RefreshScreens();
		}

		private static void RefreshColors()
		{
			if(NativeFunctions.ColorDepth>=16)
			{
				int red=(int)((System.Drawing.SystemColors.Highlight.R-System.Drawing.SystemColors.Window.R)*.30+System.Drawing.SystemColors.Window.R);
				int green=(int)((System.Drawing.SystemColors.Highlight.G-System.Drawing.SystemColors.Window.G)*.30+System.Drawing.SystemColors.Window.G);
				int blue=(int)((System.Drawing.SystemColors.Highlight.B-System.Drawing.SystemColors.Window.B)*.30+System.Drawing.SystemColors.Window.B);
				m_HoverBackColor=Color.FromArgb(red,green,blue);

				red=(int)((System.Drawing.SystemColors.Highlight.R-System.Drawing.SystemColors.Window.R)*.45+System.Drawing.SystemColors.Window.R);
				green=(int)((System.Drawing.SystemColors.Highlight.G-System.Drawing.SystemColors.Window.G)*.45+System.Drawing.SystemColors.Window.G);
				blue=(int)((System.Drawing.SystemColors.Highlight.B-System.Drawing.SystemColors.Window.B)*.45+System.Drawing.SystemColors.Window.B);
				m_HoverBackColor2=Color.FromArgb(red,green,blue);

				red=(int)((System.Drawing.SystemColors.Highlight.R-System.Drawing.SystemColors.Window.R)*.10+System.Drawing.SystemColors.Window.R);
				green=(int)((System.Drawing.SystemColors.Highlight.G-System.Drawing.SystemColors.Window.G)*.10+System.Drawing.SystemColors.Window.G);
				blue=(int)((System.Drawing.SystemColors.Highlight.B-System.Drawing.SystemColors.Window.B)*.10+System.Drawing.SystemColors.Window.B);
				m_HoverBackColor3=Color.FromArgb(red,green,blue);

				red=(int)((System.Drawing.SystemColors.Highlight.R-System.Drawing.SystemColors.Window.R)*.25+System.Drawing.SystemColors.Window.R);
后面还有 372 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。