# rect-detect

> rect detect

Latest version **0.0.7** (published 2022-07-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install rect-detect
pnpm add rect-detect
yarn add rect-detect
bun add rect-detect
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2022-07-25 |
| First published | 2022-07-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ahaoboy |
| Maintainers | ahaoboy |
| Keywords | detect, rect |

## Links

- npm: https://www.npmjs.com/package/rect-detect
- Repository: https://github.com/ahaoboy/rect-detect
- Homepage: https://github.com/ahaoboy/rect-detect#readme
- Issues: https://github.com/ahaoboy/rect-detect/issues
- npm.io page: https://npm.io/package/rect-detect

## Recent versions

- 0.0.7 (latest) — 2022-07-25
- 0.0.6 — 2022-07-25
- 0.0.5 — 2022-07-12
- 0.0.4 — 2022-07-11
- 0.0.3 — 2022-07-07
- 0.0.2 — 2022-07-07
- 0.0.1 — 2022-07-02

## README

[demo](https://rect-detect.vercel.app/)

```
npm i rect-detect
```


```
import { rectDetect, circleDetect } from "rect-detect";

const rect = rectDetect(pixel, width, height, {
    color: [0, 0, 0, 255],
}) 

ctx.fillStyle = "red";

for (const [x, y, w, h] of rect) {
    ctx.beginPath();
    ctx.rect(x, y, w, h);
    ctx.strokeStyle = "red";
    ctx.stroke();
}


const circle = circleDetect(pixel, width, height, {
    color: [0, 0, 255, 255],
});

for (const [x, y, r] of circle) {
    ctx.beginPath();
    ctx.arc(x, y, r, 0, 2 * Math.PI, false);
    ctx.lineWidth = 1;
    ctx.strokeStyle = R;
    ctx.stroke();
}
```

---
_Source: https://npm.io/package/rect-detect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
