{"_id":"@bananaseed/qgfx","_rev":"2-4a792fc9fbaa490a59840033c944bd0b","name":"@bananaseed/qgfx","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@bananaseed/qgfx","version":"1.0.0","author":{"name":"Ryan Childs"},"license":"ISC","_id":"@bananaseed/qgfx@1.0.0","maintainers":[{"name":"bananaseed","email":"bananaseedgames@gmail.com"}],"dist":{"shasum":"2e51b84f36cc399f54368af48b1518bbca1210db","tarball":"https://registry.npmjs.org/@bananaseed/qgfx/-/qgfx-1.0.0.tgz","fileCount":15,"integrity":"sha512-J3sqI26P6KKyleZibMB1bWBkEl0Oai/mrw4r4cHwvzspnDgPHLrGfdPIlRDpRBCOZyVw2sxOb5xx3Jwp2gluSw==","signatures":[{"sig":"MEUCIQCFRpiMBZ8zNQpdn/3gVTAZY350S3P2PzfzAysV+ND9MQIgD/j+BqOp/ICT24VeWEYNQzDcU9u52v8j6fE+x+TDAto=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":233940},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","source":"src/index.ts","scripts":{"build":"npm run clean && parcel build","clean":"rm -rf dist","watch":"parcel watch","prepare":"npm run build","serve-test":"parcel test/index.html","prepublishOnly":"npm run build"},"targets":{"main":{"source":"src/index.ts"},"types":{"source":"src/index.ts"},"module":{"source":"src/index.ts"}},"_npmUser":{"name":"bananaseed","email":"bananaseedgames@gmail.com"},"_npmVersion":"11.11.0","description":"qgfx is a functional graphics library for the HTML5 Canvas API. It provides a composable way to build and transform complex drawings using simple primitives and transforms.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.16.4","typescript":"^6.0.3","@parcel/packager-ts":"^2.16.4","@parcel/transformer-typescript-types":"^2.16.4"},"_npmOperationalInternal":{"tmp":"tmp/qgfx_1.0.0_1777498019449_0.8089198974288458","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@bananaseed/qgfx","version":"1.1.1","description":"qgfx is a functional graphics library for the HTML5 Canvas API. It provides a composable way to build and transform complex vector graphics images using simple primitives and transforms.","license":"ISC","author":{"name":"Ryan Childs"},"type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/childsr/qgfx.git"},"scripts":{"clean":"rm -rf dist","watch":"vite build --watch","serve-test":"vite","build":"npm run clean && vite build","prepare":"npm run build","prepublishOnly":"npm run build"},"publishConfig":{"access":"public","provenance":true},"release":{"branches":["main"]},"devDependencies":{"semantic-release":"^25.0.3","typescript":"^6.0.3","vite":"^8.0.16","vite-plugin-dts":"^5.0.2"},"gitHead":"148dcd7b40ed40ba464d4b69f12cc551a0107449","_id":"@bananaseed/qgfx@1.1.1","bugs":{"url":"https://github.com/childsr/qgfx/issues"},"homepage":"https://github.com/childsr/qgfx#readme","_nodeVersion":"22.22.3","_npmVersion":"11.16.0","dist":{"integrity":"sha512-W5Bmw5n+fOMra8ETnas/c2Ceg3JLIa+8RT2mkyZJsG7E6kn0CdXjH3B57p+qHtUEgfyII48elTRCEMLR0A7h8w==","shasum":"03bba995319cdc82a6a25e84872d3a4e45f5e43c","tarball":"https://registry.npmjs.org/@bananaseed/qgfx/-/qgfx-1.1.1.tgz","fileCount":28,"unpackedSize":188440,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bananaseed%2fqgfx@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE2Ojb+lccs+Mzr2skSgXwEvJo41PV89YraMxV3L0JLeAiB/fNfdpmWtGyCrndNpqdLdTO5gfpAcy5DCyaD4Ym1DHQ=="}]},"_npmUser":{"name":"bananaseed","email":"bananaseedgames@gmail.com"},"directories":{},"maintainers":[{"name":"bananaseed","email":"bananaseedgames@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/qgfx_1.1.1_1780425840358_0.8232063649174992"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-29T21:26:59.327Z","modified":"2026-06-02T18:44:00.795Z","1.0.0":"2026-04-29T21:26:59.573Z","1.1.1":"2026-06-02T18:44:00.498Z"},"author":{"name":"Ryan Childs"},"license":"ISC","description":"qgfx is a functional graphics library for the HTML5 Canvas API. It provides a composable way to build and transform complex vector graphics images using simple primitives and transforms.","maintainers":[{"name":"bananaseed","email":"bananaseedgames@gmail.com"}],"readme":"# @bananaseed/qgfx\n\nqgfx is a functional graphics library for the HTML5 Canvas API. It provides a composable way to build and transform complex vector graphics images using simple primitives and transforms.\n\n## Installation\n\n```bash\nnpm install @bananaseed/qgfx\n```\n\n## Core Concepts\n\nThe library is built around two primary types:\n\n- **Picture**: A function that takes a `CanvasRenderingContext2D` and performs drawing operations.\n- **Transform**: A function that takes a `Picture` and returns a new `Picture` with modifications (like translation, scaling, or styling).\n\n```typescript\ntype Picture = (ctx: CanvasRenderingContext2D) => void\ntype Transform = (pic: Picture) => Picture\n```\n\n## Primitives\n\n### Pictures\n- `blank`: An empty picture.\n- `rect`: A 1x1 unit rectangle.\n- `circle`: A unit circle.\n- `segment(pt1, pt2)`: A line segment between two points.\n- **Path Builder**: An API for creating complex paths from drawing commands similar to Canvas 2D path commands.\n\n### Transforms\n- `translate(x, y)`\n- `scale(x, y)`\n- `rotate(angle)`\n- `flipX`, `flipY`\n- `mirrorX`, `mirrorY`\n- `clip(region)`\n- `fill(fillStyle)`\n- `stroke(strokeStyle)`\n\n### Styling\n- **Colors**: Support for CSS strings, RGB/HSL, and hex codes.\n- **Color Operators**: `hueRotate`, `saturate`, `lighten`\n- **Gradients and Patterns**.\n\n## Example Usage\n\n```typescript\nimport { rect, fill, translate, overlay } from '@bananaseed/qgfx';\n\nconst redRect = fill('red')(rect)\nconst shiftedRect = translate(10, 10)(redRect)\n\nconst main = overlay([\n  rect,\n  shiftedRect\n])\n\nconst canvas = document.getElementById('myCanvas')\nconst ctx = canvas.getContext('2d')\nmain(ctx)\n```\n\n## License\n\nISC\n","readmeFilename":"README.md","homepage":"https://github.com/childsr/qgfx#readme","repository":{"type":"git","url":"git+https://github.com/childsr/qgfx.git"},"bugs":{"url":"https://github.com/childsr/qgfx/issues"}}