diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d8985ca138..9893915a4a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -91,3 +91,4 @@ The following people have contributed to the development of Rich: - [L. Yeung](https://github.com/lewis-yeung) - [chthollyphile](https://github.com/chthollyphile) - [Jonathan Helmus](https://github.com/jjhelmus) +- [Brandon Capener](https://github.com/bcapener) diff --git a/rich/style.py b/rich/style.py index 262fd6ecad..835d06f3eb 100644 --- a/rich/style.py +++ b/rich/style.py @@ -524,7 +524,7 @@ def parse(cls, style_definition: str) -> "Style": if not word: raise errors.StyleSyntaxError("color expected after 'on'") try: - Color.parse(word) is None + Color.parse(word) except ColorParseError as error: raise errors.StyleSyntaxError( f"unable to parse {word!r} as background color; {error}"