1.0.0 • Published 2 years ago

@taep96/squircle-path v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

squircle-path

Generate squircle paths

Installation

bun install @taep96/squircle-path

Usage

import { squirclePath } from "@taep96/squircle-path";

const squircle = squirclePath({ width: 256, height: 256, squarness: 0.5 });

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

<img
  style={{ "clip-path": `path("${squircle}")` }}
  src="./image.png"
  alt="squircle"
  width="256"
  height="256"
/>

Options

NameTypeDefaultDescription
widthnumberWidth of the squircle
heightnumberHeight of the squircle
squarnessnumber?0.3Squarness of the squircle. 0 is a circle, 1 is a square, 0.5 is a perfect squircle
1.0.0

2 years ago