Internal helper to get the default value of the color flag. If a value is passed it's returned unchanged, otherwise it's looked up from the current context.
(color: bool | None = None)
| 52 | |
| 53 | |
| 54 | def resolve_color_default(color: bool | None = None) -> bool | None: |
| 55 | """Internal helper to get the default value of the color flag. If a |
| 56 | value is passed it's returned unchanged, otherwise it's looked up from |
| 57 | the current context. |
| 58 | """ |
| 59 | if color is not None: |
| 60 | return color |
| 61 | |
| 62 | ctx = get_current_context(silent=True) |
| 63 | |
| 64 | if ctx is not None: |
| 65 | return ctx.color |
| 66 | |
| 67 | return None |
no test coverage detected
searching dependent graphs…