From 088d94d44da843db403b8b01169790471a95fd17 Mon Sep 17 00:00:00 2001 From: stopdropandrew Date: Wed, 13 Sep 2017 10:31:47 -0700 Subject: [PATCH] Update build artifacts --- dist/Vibrant.js | 2 +- dist/Vibrant.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/Vibrant.js b/dist/Vibrant.js index ff47dcd..bd4ede7 100644 --- a/dist/Vibrant.js +++ b/dist/Vibrant.js @@ -750,7 +750,7 @@ module.exports = MMCQ.quantize DarkVibrant: this.DarkVibrantSwatch, DarkMuted: this.DarkMutedSwatch, LightVibrant: this.LightVibrantSwatch, - LightMuted: this.LightMuted + LightMuted: this.LightMutedSwatch }; }; diff --git a/dist/Vibrant.min.js b/dist/Vibrant.min.js index 204c6d9..5a44d83 100644 --- a/dist/Vibrant.min.js +++ b/dist/Vibrant.min.js @@ -17,7 +17,7 @@ this.MIN_LIGHT_LUMA,1,this.TARGET_VIBRANT_SATURATION,this.MIN_VIBRANT_SATURATION 0,this.MAX_MUTED_SATURATION);return this.DarkMutedSwatch=this.findColorVariation(this.TARGET_DARK_LUMA,0,this.MAX_DARK_LUMA,this.TARGET_MUTED_SATURATION,0,this.MAX_MUTED_SATURATION)};a.prototype.generateEmptySwatches=function(){if(void 0===this.VibrantSwatch&&void 0!==this.DarkVibrantSwatch){var e=this.DarkVibrantSwatch.getHsl();e[2]=this.TARGET_NORMAL_LUMA;this.VibrantSwatch=new d(a.hslToRgb(e[0],e[1],e[2]),0)}if(void 0===this.DarkVibrantSwatch&&void 0!==this.VibrantSwatch)return e=this.VibrantSwatch.getHsl(), e[2]=this.TARGET_DARK_LUMA,this.DarkVibrantSwatch=new d(a.hslToRgb(e[0],e[1],e[2]),0)};a.prototype.findMaxPopulation=function(){var a;var c=0;var b=this._swatches;var d=0;for(a=b.length;d=h&&p<=f&&x>=c&&x<=b&&!this.isAlreadySelected(m)&&(x=this.createComparisonValue(p, d,x,a,m.getPopulation(),this.HighestPopulation),void 0===l||x>n)&&(l=m,n=x)}return l};a.prototype.createComparisonValue=function(a,c,b,d,h,f){return this.weightedMean(this.invertDiff(a,c),this.WEIGHT_SATURATION,this.invertDiff(b,d),this.WEIGHT_LUMA,h/f,this.WEIGHT_POPULATION)};a.prototype.invertDiff=function(a,c){return 1-Math.abs(a-c)};a.prototype.weightedMean=function(){var a,c,b;var d=1<=arguments.length?q.call(arguments,0):[];for(a=b=c=0;ac&&(c+=1);1c?b:c<2/3?a+(b-a)*(2/3-c)*6:a};0===c?d=e=f=b:(c=.5>b?b*(1+c):b+c-b*c,b=2*b-c,d=f(b,c,a+1/3),e=f(b,c,a),f=f(b,c,a-1/3));return[255*d,255*e,255*f]};return a}();window.CanvasImage= +b};a.prototype.swatches=function(){return{Vibrant:this.VibrantSwatch,Muted:this.MutedSwatch,DarkVibrant:this.DarkVibrantSwatch,DarkMuted:this.DarkMutedSwatch,LightVibrant:this.LightVibrantSwatch,LightMuted:this.LightMutedSwatch}};a.prototype.isAlreadySelected=function(a){return this.VibrantSwatch===a||this.DarkVibrantSwatch===a||this.LightVibrantSwatch===a||this.MutedSwatch===a||this.DarkMutedSwatch===a||this.LightMutedSwatch===a};a.rgbToHsl=function(a,c,b){a/=255;c/=255;b/=255;var e=Math.max(a,c, +b);var d=Math.min(a,c,b);var f=void 0;var g=(e+d)/2;if(e===d)f=d=0;else{var h=e-d;d=.5c&&(c+=1);1c?b:c<2/3?a+(b-a)*(2/3-c)*6:a};0===c?d=e=f=b:(c=.5>b?b*(1+c):b+c-b*c,b=2*b-c,d=f(b,c,a+1/3),e=f(b,c,a),f=f(b,c,a-1/3));return[255*d,255*e,255*f]};return a}();window.CanvasImage= u=function(){function a(a){this.canvas=document.createElement("canvas");this.context=this.canvas.getContext("2d");document.body.appendChild(this.canvas);this.width=this.canvas.width=a.width;this.height=this.canvas.height=a.height;this.context.drawImage(a,0,0,this.width,this.height)}a.prototype.clear=function(){return this.context.clearRect(0,0,this.width,this.height)};a.prototype.update=function(a){return this.context.putImageData(a,0,0)};a.prototype.getPixelCount=function(){return this.width*this.height}; a.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)};a.prototype.removeCanvas=function(){return this.canvas.parentNode.removeChild(this.canvas)};return a}()}).call(this)},{quantize:1}]},{},[2]);