StyleSyntaxError: unable to parse 'ansi_green' as color; 'ansi_green' is not a valid color
Author: ABDsheikhoCreated Aug 4, 2026Updated Aug 8, 2026
Whenever I'm selecting ansi-dark them I'm getting the following error:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/lib/python3.14/site-packages/posting/widgets/text_area.py:179 in on_theme_change │
│ │
│ 176 │ │ │ │ ) │
│ 177 │ │ else: │
│ 178 │ │ │ # Generate a TextAreaTheme from the Textual them │
│ ❱ 179 │ │ │ text_area_theme = Theme.text_area_theme_from_theme_variables( │
│ 180 │ │ │ │ self.app.theme_variables │
│ 181 │ │ │ ) │
│ 182 │ │ │ self.register_theme(text_area_theme) │
│ │
│ ╭───────────────────────────────── locals ──────────────────────────────────╮ │
│ │ builtin_theme = None │ │
│ │ self = ResponseTextArea(classes='empty -read-only') │ │
│ │ theme = Theme( │ │
│ │ │ name='ansi-dark', │ │
│ │ │ primary='ansi_blue', │ │
│ │ │ secondary='ansi_cyan', │ │
│ │ │ warning='ansi_yellow', │ │
│ │ │ error='ansi_red', │ │
│ │ │ success='ansi_green', │ │
│ │ │ accent='ansi_green', │ │
│ │ │ foreground='ansi_default', │ │
│ │ │ background='ansi_default', │ │
│ │ │ surface='ansi_default', │ │
│ │ │ panel='ansi_default', │ │
│ │ │ boost='ansi_default', │ │
│ │ │ dark=True, │ │
│ │ │ luminosity_spread=0.15, │ │
│ │ │ text_alpha=0.95, │ │
│ │ │ variables={ │ │
│ │ │ │ 'ansi-background': 'ansi_black', │ │
│ │ │ │ 'ansi-foreground': 'ansi_white', │ │
│ │ │ │ 'border-blurred': 'ansi_black', │ │
│ │ │ │ 'block-cursor-foreground': 'ansi_black', │ │
│ │ │ │ 'block-cursor-background': 'ansi_white', │ │
│ │ │ │ 'input-cursor-background': 'ansi_black', │ │
│ │ │ │ 'input-cursor-foreground': 'ansi_bright_white', │ │
│ │ │ │ 'input-cursor-text-style': 'none', │ │
│ │ │ │ 'input-selection-background': 'ansi_bright_blue', │ │
│ │ │ │ 'input-selection-foreground': 'ansi_black', │ │
│ │ │ │ ... +2 │ │
│ │ │ }, │ │
│ │ │ ansi=True │ │
│ │ ) │ │
│ ╰───────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib/python3.14/site-packages/posting/themes.py:260 in text_area_theme_from_theme_variables │
│ │
│ 257 │ │ │
│ 258 │ │ # Infer reasonable default syntax styles from the theme variables. │
│ 259 │ │ syntax_styles = { │
│ ❱ 260 │ │ │ "string": Style.parse( │
│ 261 │ │ │ │ variables.get("syntax-json-string", variables["text-accent"]) │
│ 262 │ │ │ ), │
│ 263 │ │ │ "number": Style.parse( │
│ │
│ ╭─────────────────────────── locals ────────────────────────────╮ │
│ │ theme_variables = { │ │
│ │ │ 'primary': 'ansi_blue', │ │
│ │ │ 'secondary': 'ansi_cyan', │ │
│ │ │ 'warning': 'ansi_yellow', │ │
│ │ │ 'error': 'ansi_red', │ │
│ │ │ 'success': 'ansi_green', │ │
│ │ │ 'accent': 'ansi_green', │ │
│ │ │ 'background': 'ansi_default', │ │
│ │ │ 'foreground': 'ansi_default', │ │
│ │ │ 'primary-background': 'ansi_default', │ │
│ │ │ 'secondary-background': 'ansi_default', │ │
│ │ │ ... +158 │ │
│ │ } │ │
│ │ variables = { │ │
│ │ │ 'primary': 'ansi_blue', │ │
│ │ │ 'secondary': 'ansi_cyan', │ │
│ │ │ 'warning': 'ansi_yellow', │ │
│ │ │ 'error': 'ansi_red', │ │
│ │ │ 'success': 'ansi_green', │ │
│ │ │ 'accent': 'ansi_green', │ │
│ │ │ 'background': 'ansi_default', │ │
│ │ │ 'foreground': 'ansi_default', │ │
│ │ │ 'primary-background': 'ansi_default', │ │
│ │ │ 'secondary-background': 'ansi_default', │ │
│ │ │ ... +158 │ │
│ │ } │ │
│ ╰───────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib/python3.14/site-packages/rich/style.py:556 in parse │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
StyleSyntaxError: unable to parse 'ansi_green' as color; 'ansi_green' is not a valid colorSource: darrenburns/posting