MCPcopy Create free account
hub / github.com/denoland/std / code

Function code

fmt/colors.ts:127–133  ·  view source on GitHub ↗

* Builds color code * @param open * @param close

(open: number[], close: number)

Source from the content-addressed store, hash-verified

125 * @param close
126 */
127function code(open: number[], close: number): Code {
128 return {
129 open: `\x1b[${open.join(";")}m`,
130 close: `\x1b[${close}m`,
131 regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
132 };
133}
134
135/**
136 * Applies color and background based on color code and its associated text

Callers 15

resetFunction · 0.70
boldFunction · 0.70
dimFunction · 0.70
italicFunction · 0.70
underlineFunction · 0.70
inverseFunction · 0.70
hiddenFunction · 0.70
strikethroughFunction · 0.70
blackFunction · 0.70
redFunction · 0.70
greenFunction · 0.70
yellowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected