diff --git a/docs/funcs_color.md b/docs/funcs_color.md index 0f7bf92..eec097b 100644 --- a/docs/funcs_color.md +++ b/docs/funcs_color.md @@ -77,6 +77,12 @@ noise(3,0.1).colorama( ({time}) => Math.sin(time/5) ).out(o0) Invert color. +#### Example + +```javascript +solid(1,1,1).invert([0,1]).out(o0) +``` + ### luma `.luma( threshold, tolerance )` @@ -84,9 +90,29 @@ Invert color. * `threshold` :: float (default `0.5`) * `tolerance` :: float (default `0.1`) +#### Example + +```javascript +// default +osc(10,0,1).luma(0.5,0.1).out(o0) + +osc(10,0,[0,0.5,1,2]).luma([0.1,0.25,0.75,1].fast(0.25),0.1).out(o0) +``` + ### thresh `.thresh( threshold, tolerance )` * `threshold` :: float (default `0.5`) * `tolerance` :: float (default `0.04`) + +#### Example + +```javascript +// default +noise(3,0.1).thresh(0.5,0.04).out(o0) + +noise(3,0.1) + .thresh( ({time})=>Math.sin(time/2) , [0.04,0.25,0.75,1].fast(0.25) ) + .out(o0) +``` diff --git a/docs/funcs_geometry.md b/docs/funcs_geometry.md index f7e4bc4..1b6136a 100644 --- a/docs/funcs_geometry.md +++ b/docs/funcs_geometry.md @@ -35,7 +35,16 @@ Pixelate texture with `pixelX` segments and `pixelY` segments. #### Example ```javascript +// default +noise().pixelate(20,20).out(o0) +noise() + .mult(osc(10,0.25,1)) + .scrollY(1,0.25) + .pixelate([100,40,20,70].fast(0.25)) + .modulateRotate(src(o0).scale(0.5),0.125) + .diff(src(o0).rotate([-0.05,0.05].fast(0.125))) + .out(o0) ``` ### rotate @@ -50,14 +59,18 @@ Rotate texture. #### Example ```javascript +osc(50).rotate( ({time}) => time%360 ).out(o0) +osc(10,1,1) + .rotate( ({time}) => time%360, ({time}) => Math.sin(time*0.1)*0.05 ) + .out(o0) ``` ### scale `.scale( size, xMult, yMult )` -* `size` :: float (default `x`) +* `size` :: float (default `1.5`) * `xMult` :: float (default `1.0`) * `yMult` :: float (default `1.0`) @@ -66,7 +79,16 @@ Scale texture. #### Example ```javascript +// default +shape().scale(1.5,1,1).out() +shape().scale(1.5,[0.25,0.5,0.75,1].fast(0.25),[3,2,1]) + .invert([0,1].fast(0.25)) + .kaleid(5) + .kaleid(12) + .scale( ({time})=>Math.sin(time/5)*0.5 ) + .rotate(1,1) + .out(o0) ``` ### scrollX @@ -79,7 +101,22 @@ Scale texture. #### Example ```javascript +// default +osc(10,0,1).scrollX(0.5,0).out() +// x position +osc(10,0,1).scrollX([0,0.25,0.5,0.75,1].fast(4),0).out() + +// scroll speed +gradient(1).scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 ).out() + +gradient(0.125) + .scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 ) + .scrollY(0, ({time}) => Math.sin(time*0.01)*-0.07 ) + .pixelate([5,2,10],[15,8]) + .scale(0.15) + .modulate(noise(1,0.25)) + .out() ``` ### scrollY @@ -92,5 +129,20 @@ Scale texture. #### Example ```javascript +// default +osc(10,0,1).scrollY(0.5,0).out() +// y position +osc(10,0,1).scrollY([0,0.25,0.5,0.75,1].fast(4),0).out() + +// scroll speed +gradient(1).scrollY(0, ({time}) => Math.sin(time*0.05)*0.05 ).out() + +gradient(0.125) + .scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 ) + .scrollY(0, ({time}) => Math.sin(time*0.01)*-0.07 ) + .pixelate([5,2,10],[15,8]) + .scale(0.15) + .modulate(noise(1,0.25)) + .out() ``` diff --git a/package-lock.json b/package-lock.json index 34aa2ee..f7a5ddb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2804,7 +2804,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2822,11 +2823,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2839,15 +2842,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2950,7 +2956,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2960,6 +2967,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2972,17 +2980,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2999,6 +3010,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3071,7 +3083,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3081,6 +3094,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3156,7 +3170,8 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3186,6 +3201,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3203,6 +3219,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3241,11 +3258,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.2", - "bundled": true + "bundled": true, + "optional": true } } },