Skip to content

createStarPath

Read as Markdown

import { createStarPath, Path } from "@pibbl/core";

StarPathOptions is accepted by createStarPath(options): Path2D, which validates integer points and nonnegative inner/outer radii, then returns a fresh concave star outline. It is pure and owns no render state, event target, or cache.

<Path
style={{
d: createStarPath({ points: 5, outerRadius: 54, innerRadius: 24 }),
fill: "#f59e0b",
}}
/>

Try the Star live example.

Creates a Canvas Path2D for star geometry from validated options.

createStarPath: (options: Readonly<StarPathOptions>) => Path2D

Related API: createStarPath, StarPathOptions.

  • options — Star center, inner and outer radii, point count, and rotation. See StarPathOptions .

A native Canvas path containing the star.

StarPathOptions

View source — packages/core/src/lib/geometry/star.ts:130

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.