MCPcopy Create free account
hub / github.com/anomalyco/opencode / draw

Function draw

packages/opencode/src/cli/ui.ts:72–94  ·  view source on GitHub ↗
(line: string, fg: string, shadow: string, bg: string)

Source from the content-addressed store, hash-verified

70 }
71 const gap = " "
72 const draw = (line: string, fg: string, shadow: string, bg: string) => {
73 const parts: string[] = []
74 for (const char of line) {
75 if (char === "_") {
76 parts.push(bg, " ", reset)
77 continue
78 }
79 if (char === "^") {
80 parts.push(fg, bg, "▀", reset)
81 continue
82 }
83 if (char === "~") {
84 parts.push(shadow, "▀", reset)
85 continue
86 }
87 if (char === " ") {
88 parts.push(" ")
89 continue
90 }
91 parts.push(fg, char, reset)
92 }
93 return parts.join("")
94 }
95 glyphs.left.forEach((row, index) => {
96 if (pad) result.push(pad)
97 result.push(draw(row, left.fg, left.shadow, left.bg))

Callers 1

logoFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected