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

GetLightIndex() public method

public GetLightIndex ( ColorInfo info, byte btnFaceValue, byte highlightValue, byte windowValue ) : int
info ColorInfo
btnFaceValue byte
highlightValue byte
windowValue byte
return int
        public int GetLightIndex(ColorInfo info, byte btnFaceValue, byte highlightValue, byte windowValue)
        {
            int res = (btnFaceValue * info.BtnFaceColorPart) / 100 +
                      (highlightValue * info.HighlightColorPart) / 100 +
                      (windowValue * info.WindowColorPart) / 100;

            if (res < 0)
                res = 0;

            if (res > 255)
                res = 255;

            return res;
        }