q5 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +6 -5
- package/{q5-webgpu.js → q5-q2d.js} +225 -464
- package/q5-q2d.min.js +8 -0
- package/q5.js +710 -238
- package/q5.min.js +2 -2
- package/src/q5-2d-canvas.js +16 -15
- package/src/q5-2d-drawing.js +1 -16
- package/src/q5-color.js +30 -29
- package/src/q5-core.js +2 -2
- package/src/q5-webgpu-canvas.js +187 -16
- package/src/q5-webgpu-drawing.js +170 -82
- package/src/readme.md +20 -20
- package/q5-webgpu.min.js +0 -8
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# <img src="q5js_logo.webp" height="64"> <img src="q5js_brand.webp" height="64">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A sequel to p5.js that's smaller, faster, and optimized for interactive art!
|
|
4
4
|
|
|
5
5
|
**q5.js** implements all of [p5][]'s 2D drawing, math, and user input functionality.
|
|
6
6
|
|
|
7
|
-
It's a drop-in replacement that's
|
|
7
|
+
It's a drop-in replacement that's ~70x smaller than p5, while packing exclusive new features: HDR color support, modular use, top-level global mode, namespace mode, text image caching, dimension agnostic mode, and more.
|
|
8
8
|
|
|
9
9
|
## Typical Use
|
|
10
10
|
|
|
@@ -331,7 +331,7 @@ Features added by @LingDong-:
|
|
|
331
331
|
- `color` function only accepts numeric input, hex, and common named colors. It doesn't parse strings like `color('hsl(160, 100%, 50%)')`.
|
|
332
332
|
- `fill`, `stroke`, and `background` can accept any CSS color string.
|
|
333
333
|
- `noise` function's default noise algorithm is perlin noise. p5's default noise is called "blocky" noise in q5 and using it requires loading the src/q5-noisier.js module.
|
|
334
|
-
- `tint` doesn't change the opacity of an image, instead the tint's alpha value specifies how strong the tint should be
|
|
334
|
+
- `tint` doesn't change the opacity of an image, instead the tint's alpha value specifies how strong the tint should be. To dynamically change the opacity of anything drawn to the canvas, use `opacity(globalAlpha)`.
|
|
335
335
|
|
|
336
336
|
## Size Comparison
|
|
337
337
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q5",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "A sequel to p5.js that's smaller and faster",
|
|
5
5
|
"author": "quinton-ashley",
|
|
6
6
|
"contributors": [
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"homepage": "https://q5js.org/home",
|
|
12
12
|
"main": "q5-server.js",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"bundle": "cat src/q5-core.js src/q5-canvas.js src/q5-2d-canvas.js src/q5-2d-drawing.js src/q5-2d-image.js src/q5-2d-
|
|
15
|
-
"bundle-
|
|
16
|
-
"min": "terser q5.js --compress ecma=2024 --mangle > q5.min.js && terser q5-
|
|
17
|
-
"dist": "bun bundle && bun bundle-
|
|
14
|
+
"bundle": "cat src/q5-core.js src/q5-canvas.js src/q5-2d-canvas.js src/q5-2d-drawing.js src/q5-2d-image.js src/q5-2d-text.js src/q5-ai.js src/q5-color.js src/q5-display.js src/q5-input.js src/q5-math.js src/q5-sound.js src/q5-util.js src/q5-vector.js src/q5-webgpu-canvas.js src/q5-webgpu-drawing.js src/q5-webgpu-image.js src/q5-webgpu-text.js > q5.js",
|
|
15
|
+
"bundle-q2d": "cat src/q5-core.js src/q5-canvas.js src/q5-2d-canvas.js src/q5-2d-drawing.js src/q5-2d-image.js src/q5-2d-soft-filters.js src/q5-2d-text.js src/q5-ai.js src/q5-color.js src/q5-display.js src/q5-input.js src/q5-math.js src/q5-sound.js src/q5-util.js src/q5-vector.js > q5-q2d.js",
|
|
16
|
+
"min": "terser q5.js --compress ecma=2024 --mangle > q5.min.js && terser q5-q2d.js --compress ecma=2024 --mangle > q5-q2d.min.js",
|
|
17
|
+
"dist": "bun bundle && bun bundle-q2d && bun min",
|
|
18
|
+
"dist-p5play": "bun dist && cp q5.js ../../web/p5play-web/v3/q5.js && cp q5.min.js ../../web/p5play-web/v3/q5.min.js",
|
|
18
19
|
"v": "npm version patch --force",
|
|
19
20
|
"V": "npm version minor --force",
|
|
20
21
|
"version": "git add -A",
|