/// <summary>
        /// ParseBrush
        /// <param name="brush"> string with brush description </param>
        /// <param name="formatProvider">IFormatProvider for processing string</param>
        /// <param name="context">ITypeDescriptorContext</param>
        /// </summary>
        internal static Brush ParseBrush(string brush, IFormatProvider formatProvider, ITypeDescriptorContext context)
        {
            bool   isPossibleKnownColor;
            bool   isNumericColor;
            bool   isScRgbColor;
            bool   isContextColor;
            string trimmedColor = KnownColors.MatchColor(brush, out isPossibleKnownColor, out isNumericColor, out isContextColor, out isScRgbColor);

            if (trimmedColor.Length == 0)
            {
                throw new FormatException(SR.Get(SRID.Parser_Empty));
            }

            // Note that because trimmedColor is exactly brush.Trim() we don't have to worry about
            // extra tokens as we do with TokenizerHelper.  If we return one of the solid color
            // brushes then the ParseColor routine (or ColorStringToKnownColor) matched the entire
            // input.
            if (isNumericColor)
            {
                return(new SolidColorBrush(ParseHexColor(trimmedColor)));
            }

            if (isContextColor)
            {
                return(new SolidColorBrush(ParseContextColor(trimmedColor, formatProvider, context)));
            }

            if (isScRgbColor)
            {
                return(new SolidColorBrush(ParseScRgbColor(trimmedColor, formatProvider)));
            }

            if (isPossibleKnownColor)
            {
                SolidColorBrush scp = KnownColors.ColorStringToKnownBrush(trimmedColor);

                if (scp != null)
                {
                    return(scp);
                }
            }

            // If it's not a color, so the content is illegal.
            throw new FormatException(SR.Get(SRID.Parsers_IllegalToken));
        }