@jimp/plugin-color
Advanced tools
Comparing version 0.9.1 to 0.9.2-canary.815.538.0
"use strict"; | ||
require("core-js/modules/es6.object.define-property"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
require("core-js/modules/es.array.for-each"); | ||
require("core-js/modules/es6.string.iterator"); | ||
require("core-js/modules/es.array.is-array"); | ||
require("core-js/modules/es6.array.from"); | ||
require("core-js/modules/es.array.map"); | ||
require("core-js/modules/es6.regexp.to-string"); | ||
require("core-js/modules/es.parse-int"); | ||
require("core-js/modules/es6.date.to-string"); | ||
require("core-js/modules/web.dom-collections.for-each"); | ||
require("core-js/modules/es6.object.to-string"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
require("core-js/modules/es7.symbol.async-iterator"); | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
require("core-js/modules/es6.symbol"); | ||
require("core-js/modules/web.dom.iterable"); | ||
require("core-js/modules/es6.array.for-each"); | ||
require("core-js/modules/es6.array.map"); | ||
require("core-js/modules/es6.array.is-array"); | ||
var _tinycolor = _interopRequireDefault(require("tinycolor2")); | ||
@@ -36,12 +26,2 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function applyKernel(im, kernel, x, y) { | ||
@@ -156,3 +136,3 @@ var value = [0, 0, 0]; | ||
clr = (_clr = clr)[action.apply].apply(_clr, _toConsumableArray(action.params)).toRgb(); | ||
clr = (_clr = clr)[action.apply].apply(_clr, (0, _toConsumableArray2["default"])(action.params)).toRgb(); | ||
} | ||
@@ -159,0 +139,0 @@ }); |
@@ -1,12 +0,16 @@ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
"use strict"; | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
import tinyColor from 'tinycolor2'; | ||
import { throwError, isNodePattern } from '@jimp/utils'; | ||
var _tinycolor = _interopRequireDefault(require("tinycolor2")); | ||
var _utils = require("@jimp/utils"); | ||
function applyKernel(im, kernel, x, y) { | ||
@@ -40,3 +44,3 @@ var value = [0, 0, 0]; | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -61,3 +65,3 @@ } | ||
if (!actions || !Array.isArray(actions)) { | ||
return throwError.call(this, 'actions must be an array', cb); | ||
return _utils.throwError.call(this, 'actions must be an array', cb); | ||
} | ||
@@ -67,3 +71,3 @@ | ||
if (action.apply === 'xor' || action.apply === 'mix') { | ||
action.params[0] = tinyColor(action.params[0]).toRgb(); | ||
action.params[0] = (0, _tinycolor["default"])(action.params[0]).toRgb(); | ||
} | ||
@@ -118,9 +122,9 @@ | ||
clr = tinyColor(clr); | ||
clr = (0, _tinycolor["default"])(clr); | ||
if (!clr[action.apply]) { | ||
return throwError.call(_this, 'action ' + action.apply + ' not supported', cb); | ||
return _utils.throwError.call(_this, 'action ' + action.apply + ' not supported', cb); | ||
} | ||
clr = (_clr = clr)[action.apply].apply(_clr, _toConsumableArray(action.params)).toRgb(); | ||
clr = (_clr = clr)[action.apply].apply(_clr, (0, _toConsumableArray2["default"])(action.params)).toRgb(); | ||
} | ||
@@ -133,3 +137,3 @@ }); | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -141,3 +145,3 @@ } | ||
export default (function () { | ||
var _default = function _default() { | ||
return { | ||
@@ -152,7 +156,7 @@ /** | ||
if (typeof val !== 'number') { | ||
return throwError.call(this, 'val must be numbers', cb); | ||
return _utils.throwError.call(this, 'val must be numbers', cb); | ||
} | ||
if (val < -1 || val > +1) { | ||
return throwError.call(this, 'val must be a number between -1 and +1', cb); | ||
return _utils.throwError.call(this, 'val must be a number between -1 and +1', cb); | ||
} | ||
@@ -172,3 +176,3 @@ | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -188,7 +192,7 @@ } | ||
if (typeof val !== 'number') { | ||
return throwError.call(this, 'val must be numbers', cb); | ||
return _utils.throwError.call(this, 'val must be numbers', cb); | ||
} | ||
if (val < -1 || val > +1) { | ||
return throwError.call(this, 'val must be a number between -1 and +1', cb); | ||
return _utils.throwError.call(this, 'val must be a number between -1 and +1', cb); | ||
} | ||
@@ -209,3 +213,3 @@ | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -225,3 +229,3 @@ } | ||
if (typeof n !== 'number') { | ||
return throwError.call(this, 'n must be numbers', cb); | ||
return _utils.throwError.call(this, 'n must be numbers', cb); | ||
} | ||
@@ -240,3 +244,3 @@ | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -264,4 +268,4 @@ } | ||
opacity: function opacity(f, cb) { | ||
if (typeof f !== 'number') return throwError.call(this, 'f must be a number', cb); | ||
if (f < 0 || f > 1) return throwError.call(this, 'f must be a number from 0 to 1', cb); | ||
if (typeof f !== 'number') return _utils.throwError.call(this, 'f must be a number', cb); | ||
if (f < 0 || f > 1) return _utils.throwError.call(this, 'f must be a number from 0 to 1', cb); | ||
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) { | ||
@@ -272,3 +276,3 @@ var v = this.bitmap.data[idx + 3] * f; | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -298,3 +302,3 @@ } | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -314,7 +318,7 @@ } | ||
if (typeof f !== 'number') { | ||
return throwError.call(this, 'f must be a number', cb); | ||
return _utils.throwError.call(this, 'f must be a number', cb); | ||
} | ||
if (f < 0 || f > 1) { | ||
return throwError.call(this, 'f must be a number from 0 to 1', cb); | ||
return _utils.throwError.call(this, 'f must be a number from 0 to 1', cb); | ||
} // this method is an alternative to opacity (which may be deprecated) | ||
@@ -325,3 +329,3 @@ | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -425,3 +429,3 @@ } | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -443,3 +447,3 @@ } | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -470,19 +474,19 @@ } | ||
if (typeof size !== 'number') { | ||
return throwError.call(this, 'size must be a number', cb); | ||
return _utils.throwError.call(this, 'size must be a number', cb); | ||
} | ||
if (isDef(x) && typeof x !== 'number') { | ||
return throwError.call(this, 'x must be a number', cb); | ||
return _utils.throwError.call(this, 'x must be a number', cb); | ||
} | ||
if (isDef(y) && typeof y !== 'number') { | ||
return throwError.call(this, 'y must be a number', cb); | ||
return _utils.throwError.call(this, 'y must be a number', cb); | ||
} | ||
if (isDef(w) && typeof w !== 'number') { | ||
return throwError.call(this, 'w must be a number', cb); | ||
return _utils.throwError.call(this, 'w must be a number', cb); | ||
} | ||
if (isDef(h) && typeof h !== 'number') { | ||
return throwError.call(this, 'h must be a number', cb); | ||
return _utils.throwError.call(this, 'h must be a number', cb); | ||
} | ||
@@ -506,3 +510,3 @@ } | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -525,3 +529,3 @@ } | ||
convolute: function convolute(kernel, x, y, w, h, cb) { | ||
if (!Array.isArray(kernel)) return throwError.call(this, 'the kernel must be an array', cb); | ||
if (!Array.isArray(kernel)) return _utils.throwError.call(this, 'the kernel must be an array', cb); | ||
@@ -536,15 +540,15 @@ if (typeof x === 'function') { | ||
if (isDef(x) && typeof x !== 'number') { | ||
return throwError.call(this, 'x must be a number', cb); | ||
return _utils.throwError.call(this, 'x must be a number', cb); | ||
} | ||
if (isDef(y) && typeof y !== 'number') { | ||
return throwError.call(this, 'y must be a number', cb); | ||
return _utils.throwError.call(this, 'y must be a number', cb); | ||
} | ||
if (isDef(w) && typeof w !== 'number') { | ||
return throwError.call(this, 'w must be a number', cb); | ||
return _utils.throwError.call(this, 'w must be a number', cb); | ||
} | ||
if (isDef(h) && typeof h !== 'number') { | ||
return throwError.call(this, 'h must be a number', cb); | ||
return _utils.throwError.call(this, 'h must be a number', cb); | ||
} | ||
@@ -566,3 +570,3 @@ } | ||
if (isNodePattern(cb)) { | ||
if ((0, _utils.isNodePattern)(cb)) { | ||
cb.call(this, null, this); | ||
@@ -583,3 +587,5 @@ } | ||
}; | ||
}); | ||
}; | ||
exports["default"] = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@jimp/plugin-color", | ||
"version": "0.9.1", | ||
"version": "0.9.2-canary.815.538.0", | ||
"description": "Bitmap manipulation to adjust the color in an image.", | ||
@@ -23,10 +23,11 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "^0.9.1", | ||
"core-js": "^2.5.7", | ||
"@babel/runtime": "^7.7.2", | ||
"@jimp/utils": "0.9.2-canary.815.538.0", | ||
"core-js": "^3.4.1", | ||
"tinycolor2": "^1.4.1" | ||
}, | ||
"devDependencies": { | ||
"@jimp/custom": "^0.9.1", | ||
"@jimp/test-utils": "^0.9.1", | ||
"@jimp/types": "^0.9.1" | ||
"@jimp/custom": "0.9.2-canary.815.538.0", | ||
"@jimp/test-utils": "0.9.2-canary.815.538.0", | ||
"@jimp/types": "0.9.2-canary.815.538.0" | ||
}, | ||
@@ -39,3 +40,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c6f11425c0e8585a73109d61d3372612bfa3799f" | ||
"gitHead": "7d4c8b69bc33d98b760ad1e0acbe678ed03647f1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
408212
5
1728
+ Added@babel/runtime@^7.7.2
+ Added@jimp/utils@0.9.2-canary.815.538.0(transitive)
- Removed@jimp/utils@0.9.8(transitive)
- Removedcore-js@2.6.12(transitive)
Updatedcore-js@^3.4.1