MCPcopy
hub / github.com/Lulzx/tinypdf / rect

Function rect

src/index.ts:171–178  ·  view source on GitHub ↗
(x: number, y: number, w: number, h: number, fill: string)

Source from the content-addressed store, hash-verified

169 },
170
171 rect(x: number, y: number, w: number, h: number, fill: string) {
172 const rgb = parseColor(fill)
173 if (rgb) {
174 ops.push(`${rgb[0].toFixed(3)} ${rgb[1].toFixed(3)} ${rgb[2].toFixed(3)} rg`)
175 ops.push(`${x.toFixed(2)} ${y.toFixed(2)} ${w.toFixed(2)} ${h.toFixed(2)} re`)
176 ops.push('f')
177 }
178 },
179
180 line(x1: number, y1: number, x2: number, y2: number, stroke: string, lineWidth: number = 1) {
181 const rgb = parseColor(stroke)

Callers

nothing calls this directly

Calls 1

parseColorFunction · 0.85

Tested by

no test coverage detected