FarsiLibrary.Win.Drawing.Office2003Colors.GetLightColor C# (CSharp) Method

GetLightColor() public method

public GetLightColor ( int btnFaceColorPart, int highlightColorPart, int windowColorPart ) : Color
btnFaceColorPart int
highlightColorPart int
windowColorPart int
return Color
        public Color GetLightColor(int btnFaceColorPart, int highlightColorPart, int windowColorPart)
        {
            colorInfo.BtnFaceColorPart = btnFaceColorPart;
            colorInfo.HighlightColorPart = highlightColorPart;
            colorInfo.WindowColorPart = windowColorPart;

            Color btnFace = SystemColors.Control;
            Color highlight = SystemColors.Highlight;
            Color window = SystemColors.Window;
            Color res;

            if (btnFace == Color.White || btnFace == Color.Black)
            {
                res = highlight;
            }
            else
            {
                res = Color.FromArgb(
                    GetLightIndex(colorInfo, btnFace.R, highlight.R, window.R),
                    GetLightIndex(colorInfo, btnFace.G, highlight.G, window.G),
                    GetLightIndex(colorInfo, btnFace.B, highlight.B, window.B));
            }
            return res;
        }