Beispiel #1
0
        internal static Color DisabledTextColor(Color backColor)
        {
            Color controlDark = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                controlDark = ControlPaint.Dark(backColor);
            }
            return(controlDark);
        }
Beispiel #2
0
        internal static Color DisabledTextColor(Color backColor)
        {
            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
Beispiel #3
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast)
            {
                return(SystemColors.GrayText);
            }

            // If the color is darker than SystemColors.Control make it slightly darker,
            // otherwise use the standard control dark color.

            return(ControlPaint.IsDarker(backColor, SystemColors.Control)
                ? ControlPaint.Dark(backColor)
                : SystemColors.ControlDark);
        }
Beispiel #4
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
Beispiel #5
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast && AccessibilityImprovements.Level1)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
Beispiel #6
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast && !LocalAppContextSwitches.UseLegacyAccessibilityFeatures)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }