()
| 46 | // --------------------------------------------------------------------------- |
| 47 | |
| 48 | export function printBanner(): void { |
| 49 | if (!isColorSupported || !process.stdout.isTTY) return; |
| 50 | |
| 51 | const maxWidth = Math.max(...BANNER.map((r) => r.length)); |
| 52 | |
| 53 | console.log(); |
| 54 | for (const row of BANNER) { |
| 55 | let line = " "; |
| 56 | for (let col = 0; col < row.length; col++) { |
| 57 | const ch = row[col]; |
| 58 | if (!ch || ch === " ") { |
| 59 | line += " "; |
| 60 | continue; |
| 61 | } |
| 62 | const t = maxWidth > 1 ? col / (maxWidth - 1) : 0; |
| 63 | const [r, g, b] = gradientColor(t); |
| 64 | line += rgb(r, g, b, ch); |
| 65 | } |
| 66 | console.log(line); |
| 67 | } |
| 68 | console.log(); |
| 69 | } |
no test coverage detected