# resolve_theme_name

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/configuration/theme_resolution/resolve_theme_name)

Resolve a user-supplied theme name to a canonical registry key.

Accepts the registry key or the human-readable label, case-insensitive on
both, with surrounding whitespace stripped - config values (especially
`[ui.terminal_themes]`) and the `DEEPAGENTS_CODE_THEME` env var are commonly
hand-edited. Also applies the legacy `textual-ansi` to `ansi-light`
migration, which predates Textual 8.2.5 and can be dropped once no
supported config can still carry the old name.

## Signature

```python
resolve_theme_name(
    value: object,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `value` | `object` | Yes | Raw value read from TOML or an environment variable. |

## Returns

`str | None`

Canonical registry key, or `None` when the value is not a string or

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/configuration/theme_resolution.py#L17)