Toggle Sidebar B
Light & dark mode D

Polygon

Regular polygon with adjustable sides and corner rounding

Regular polygon with adjustable sides and corner rounding

Props

PropTypeDefaultDescription
colorcolor#ffffffFill color of the polygon
centerposition{"x":0.5,"y":0.5}Center position of the polygon
radiusrange0.4Circumradius - distance from center to vertices in UV space
sidesrange6Number of sides (3 = triangle, 4 = square, 6 = hexagon, etc.)
roundingrange0Corner rounding - 0 is sharp vertices, 1 morphs into a circle
rotationrange0Rotation in degrees
softnessrange0Edge softness for antialiasing
strokeThicknessrange0Stroke thickness. Zero means no stroke.
strokeColorcolor#000000Color of the stroke outline
strokePosition"outside" | "center" | "inside"centerPosition of the stroke relative to the shape edge
colorSpace"linear" | "oklch" | "oklab" | "hsl" | "hsv" | "lch"linearColor space for blending fill and stroke colors

Usage

vue
<Shader>
  <Polygon
    color="#ffffff"
    :radius="0.4"
  />
</Shader>