Polygon
Regular polygon with adjustable sides and corner rounding
Props
Prop
Details
colorstringDefault:
#ffffffFill color of the polygon
colorstringDefault: #ffffffFill color of the polygon
center{x: number, y: number}Default:
{"x":0.5,"y":0.5}Center position of the polygon
center{x: number, y: number}Default: {"x":0.5,"y":0.5}Center position of the polygon
radiusnumberDefault:
0.4Circumradius — distance from center to vertices in UV space
radiusnumberDefault: 0.4Circumradius — distance from center to vertices in UV space
sidesnumberDefault:
6Number of sides (3 = triangle, 4 = square, 6 = hexagon, etc.)
sidesnumberDefault: 6Number of sides (3 = triangle, 4 = square, 6 = hexagon, etc.)
roundingnumberDefault:
0Corner rounding — 0 is sharp vertices, 1 morphs into a circle
roundingnumberDefault: 0Corner rounding — 0 is sharp vertices, 1 morphs into a circle
rotationnumberDefault:
0Rotation in degrees
rotationnumberDefault: 0Rotation in degrees
softnessnumberDefault:
0Edge softness for antialiasing
softnessnumberDefault: 0Edge softness for antialiasing
strokeThicknessnumberDefault:
0Stroke thickness. Zero means no stroke.
strokeThicknessnumberDefault: 0Stroke thickness. Zero means no stroke.
strokeColorstringDefault:
#000000Color of the stroke outline
strokeColorstringDefault: #000000Color of the stroke outline
strokePosition"outside" | "center" | "inside"Default:
centerPosition of the stroke relative to the shape edge
strokePosition"outside" | "center" | "inside"Default: centerPosition of the stroke relative to the shape edge
colorSpace"linear" | "oklch" | "oklab" | "hsl" | "hsv" | "lch"Default:
linearColor space for blending fill and stroke colors
colorSpace"linear" | "oklch" | "oklab" | "hsl" | "hsv" | "lch"Default: linearColor space for blending fill and stroke colors
Usage
<Shader>
<Polygon
color="#ffffff"
:radius="0.4"
/>
</Shader>