add degrade/degradeBy
This commit is contained in:
parent
c88508ace3
commit
dca8b46abf
1 changed files with 14 additions and 0 deletions
|
|
@ -88,3 +88,17 @@ export const perlinWith = (pat) => {
|
|||
};
|
||||
|
||||
export const perlin = perlinWith(time);
|
||||
|
||||
Pattern.prototype._degradeByWith = function (withPat, x) {
|
||||
return this.fmap((a) => (_) => a).appLeft(withPat._filterValues((v) => v > x));
|
||||
};
|
||||
|
||||
Pattern.prototype._degradeBy = function (x) {
|
||||
return this._degradeByWith(rand, x);
|
||||
};
|
||||
|
||||
Pattern.prototype._degrade = function () {
|
||||
return this._degradeBy(0.5);
|
||||
};
|
||||
|
||||
Pattern.prototype.patternified.push('degradeBy', 'degrade');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue