Better validation and test coverage for background colours

This commit is contained in:
Lovell Fuller
2019-08-16 20:37:17 +01:00
parent e4333ff6b0
commit da4e05c118
6 changed files with 33 additions and 16 deletions

View File

@@ -239,7 +239,7 @@ function resize (width, height, options) {
}
// Background
if (is.defined(options.background)) {
this._setColourOption('resizeBackground', options.background);
this._setBackgroundColourOption('resizeBackground', options.background);
}
// Kernel
if (is.defined(options.kernel)) {
@@ -305,7 +305,7 @@ function extend (extend) {
this.options.extendBottom = extend.bottom;
this.options.extendLeft = extend.left;
this.options.extendRight = extend.right;
this._setColourOption('extendBackground', extend.background);
this._setBackgroundColourOption('extendBackground', extend.background);
} else {
throw is.invalidParameterError('extend', 'integer or object', extend);
}