⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colorhelper.cs

📁 Magic Library 1.7,有说明文档
💻 CS
字号:
// *****************************************************************************
// 
//  (c) Crownwood Consulting Limited 2002 
//  All rights reserved. The software and associated documentation 
//  supplied hereunder are the proprietary information of Crownwood Consulting 
//	Limited, Haxey, North Lincolnshire, England and are supplied subject to 
//	licence terms.
// 
//  Magic Version 1.7 	www.dotnetmagic.com
// *****************************************************************************

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using Crownwood.Magic.Win32;

namespace Crownwood.Magic.Common
{
    public class ColorHelper
    {
        public static Color TabBackgroundFromBaseColor(Color backColor)
        {
            Color backIDE;

            // Check for the 'Classic' control color
            if ((backColor.R == 212) &&
                (backColor.G == 208) &&
                (backColor.B == 200))
            {
                // Use the exact background for this color
                backIDE = Color.FromArgb(247, 243, 233);
            }
            else
            {
                // Check for the 'XP' control color
                if ((backColor.R == 236) &&
                    (backColor.G == 233) &&
                    (backColor.B == 216))
                {
                    // Use the exact background for this color
                    backIDE = Color.FromArgb(255, 251, 233);
                }
                else
                {
                    // Calculate the IDE background color as only half as dark as the control color
                    int red = 255 - ((255 - backColor.R) / 2);
                    int green = 255 - ((255 - backColor.G) / 2);
                    int blue = 255 - ((255 - backColor.B) / 2);
                    backIDE = Color.FromArgb(red, green, blue);
                }
            }
                        
            return backIDE;
        }
    }
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -