MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / polygon

Function polygon

packages/cli/src/commands/motionShotLayout.ts:148–156  ·  view source on GitHub ↗
(corners: Pt[], fill: string, fillOpacity: number, stroke: string)

Source from the content-addressed store, hash-verified

146 .join(" ");
147
148const polygon = (corners: Pt[], fill: string, fillOpacity: number, stroke: string) =>
149 `<polygon ${attrs({
150 points: corners.map((p) => `${round(p.x)},${round(p.y)}`).join(" "),
151 fill,
152 "fill-opacity": fillOpacity.toFixed(2),
153 stroke,
154 "stroke-width": 2.5,
155 "stroke-linejoin": "round",
156 })}/>`;
157
158const line = (a: Pt, b: Pt, stroke: string, w: number, o: number) =>
159 `<line ${attrs({ x1: round(a.x), y1: round(a.y), x2: round(b.x), y2: round(b.y), stroke, "stroke-width": w, opacity: o, "stroke-linecap": "round" })}/>`;

Callers 1

ghostFunction · 0.85

Calls 2

attrsFunction · 0.85
roundFunction · 0.70

Tested by

no test coverage detected