MCPcopy Index your code
hub / github.com/callstack/agent-device / solidPngBuffer

Function solidPngBuffer

src/__tests__/cli-diff.test.ts:19–32  ·  view source on GitHub ↗

Create a solid-color PNG buffer.

(
  width: number,
  height: number,
  color: { r: number; g: number; b: number },
)

Source from the content-addressed store, hash-verified

17
18/** Create a solid-color PNG buffer. */
19function solidPngBuffer(
20 width: number,
21 height: number,
22 color: { r: number; g: number; b: number },
23): Buffer {
24 const png = new PNG({ width, height });
25 for (let i = 0; i < png.data.length; i += 4) {
26 png.data[i] = color.r;
27 png.data[i + 1] = color.g;
28 png.data[i + 2] = color.b;
29 png.data[i + 3] = 255;
30 }
31 return PNG.sync.write(png);
32}
33
34async function runCliCapture(
35 argv: string[],

Callers 2

sendToDaemonFunction · 0.70
cli-diff.test.tsFile · 0.70

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected