@palett/projector
Advanced tools
Comparing version 0.3.6 to 0.3.7
@@ -76,12 +76,2 @@ 'use strict'; | ||
const scale = (x, min, lever, base, ceil) => comparer.min((comparer.max(x, min) - min) * lever + base, ceil); | ||
const projector = function (x) { | ||
const { | ||
min: m, | ||
lever: [rH, rS, rL], | ||
base: [mH, mS, mL], | ||
effects | ||
} = this; | ||
return hslToDye.call(effects, [scale(x, m, rH, mH, 360), scale(x, m, rS, mS, 100), scale(x, m, rL, mL, 100)]); | ||
}; | ||
/** | ||
@@ -92,13 +82,11 @@ * | ||
* @param {string[]} [effects] | ||
* @returns {function(*):function} | ||
* @returns {function(*):Function} | ||
*/ | ||
const Projector = (bound, preset, effects) => { | ||
var _bound, _preset; | ||
if (!bound) return void 0; | ||
bound = (_bound = bound, boundToLeap(_bound)); | ||
bound = boundToLeap(bound); | ||
/** @type {{min:number[],dif:number[]}} */ | ||
const leap = (_preset = preset, utilFluo.presetToLeap(_preset)); | ||
const leap = utilFluo.presetToLeap(preset); | ||
@@ -117,2 +105,12 @@ if (!bound.dif) { | ||
}; | ||
const scale = (x, min, lever, base, ceil) => comparer.min((comparer.max(x, min) - min) * lever + base, ceil); | ||
const projector = function (x) { | ||
const { | ||
min: m, | ||
lever: [rH, rS, rL], | ||
base: [mH, mS, mL], | ||
effects | ||
} = this; | ||
return hslToDye.call(effects, [scale(x, m, rH, mH, 360), scale(x, m, rS, mS, 100), scale(x, m, rL, mL, 100)]); | ||
}; | ||
@@ -119,0 +117,0 @@ const Colorant = (bound, preset = presets.PLANET, effects) => { |
@@ -72,12 +72,2 @@ import { min, max } from '@aryth/comparer'; | ||
const scale = (x, min$1, lever, base, ceil) => min((max(x, min$1) - min$1) * lever + base, ceil); | ||
const projector = function (x) { | ||
const { | ||
min: m, | ||
lever: [rH, rS, rL], | ||
base: [mH, mS, mL], | ||
effects | ||
} = this; | ||
return hslToDye.call(effects, [scale(x, m, rH, mH, 360), scale(x, m, rS, mS, 100), scale(x, m, rL, mL, 100)]); | ||
}; | ||
/** | ||
@@ -88,13 +78,11 @@ * | ||
* @param {string[]} [effects] | ||
* @returns {function(*):function} | ||
* @returns {function(*):Function} | ||
*/ | ||
const Projector = (bound, preset, effects) => { | ||
var _bound, _preset; | ||
if (!bound) return void 0; | ||
bound = (_bound = bound, boundToLeap(_bound)); | ||
bound = boundToLeap(bound); | ||
/** @type {{min:number[],dif:number[]}} */ | ||
const leap = (_preset = preset, presetToLeap(_preset)); | ||
const leap = presetToLeap(preset); | ||
@@ -113,2 +101,12 @@ if (!bound.dif) { | ||
}; | ||
const scale = (x, min$1, lever, base, ceil) => min((max(x, min$1) - min$1) * lever + base, ceil); | ||
const projector = function (x) { | ||
const { | ||
min: m, | ||
lever: [rH, rS, rL], | ||
base: [mH, mS, mL], | ||
effects | ||
} = this; | ||
return hslToDye.call(effects, [scale(x, m, rH, mH, 360), scale(x, m, rS, mS, 100), scale(x, m, rL, mL, 100)]); | ||
}; | ||
@@ -115,0 +113,0 @@ const Colorant = (bound, preset = PLANET, effects) => { |
{ | ||
"name": "@palett/projector", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "A debug tool", | ||
@@ -20,6 +20,6 @@ "main": "dist/index.cjs.js", | ||
"@ject/oneself": "^0.0.5", | ||
"@palett/convert": "^0.3.6", | ||
"@palett/dye": "^0.3.6", | ||
"@palett/presets": "^0.3.6", | ||
"@palett/util-fluo": "^0.3.6", | ||
"@palett/convert": "^0.3.7", | ||
"@palett/dye": "^0.3.7", | ||
"@palett/presets": "^0.3.7", | ||
"@palett/util-fluo": "^0.3.7", | ||
"@typen/nullish": "^0.1.5", | ||
@@ -46,3 +46,3 @@ "@typen/num-strict": "^0.1.5" | ||
"homepage": "https://github.com/hoyeungw/palett/says#readme", | ||
"gitHead": "965d1ba591a361fd8cb3997a613b32d485985cf7" | ||
"gitHead": "c05a5650638d6968b9120fe823bf12689e0cdd96" | ||
} |
9973
224
Updated@palett/convert@^0.3.7
Updated@palett/dye@^0.3.7
Updated@palett/presets@^0.3.7
Updated@palett/util-fluo@^0.3.7