( blocks: readonly Block[], mode: ColorMode, skipBackground: boolean, dim: boolean, )
| 145 | } |
| 146 | |
| 147 | function asTerminalEscaped( |
| 148 | blocks: readonly Block[], |
| 149 | mode: ColorMode, |
| 150 | skipBackground: boolean, |
| 151 | dim: boolean, |
| 152 | ): string { |
| 153 | let out = dim ? RESET + DIM : RESET |
| 154 | for (const [style, text] of blocks) { |
| 155 | out += colorToEscape(style.foreground, true, mode) |
| 156 | if (!skipBackground) { |
| 157 | out += colorToEscape(style.background, false, mode) |
| 158 | } |
| 159 | out += text |
| 160 | } |
| 161 | return out + RESET |
| 162 | } |
| 163 | |
| 164 | // --------------------------------------------------------------------------- |
| 165 | // Theme |
no test coverage detected