Skip to content

Commit

Permalink
UPDATED dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbos committed Oct 18, 2017
1 parent d0b4016 commit 0152112
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion dist/vintage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var defaultEffect = {
lighten: 0,
viewfinder: false,
sepia: false,
gray: false,
brightness: 0,
contrast: 0
};
Expand Down Expand Up @@ -120,7 +121,8 @@ var applyEffect = function applyEffect(effect) {
var data = ctx.getImageData(0, 0, width, height);
var id = data.data.slice(0);
var sepia = effect.sepia,
saturation = effect.saturation;
saturation = effect.saturation,
gray = effect.gray;


for (var i = id.length / 4; i >= 0; --i) {
Expand All @@ -139,6 +141,13 @@ var applyEffect = function applyEffect(effect) {
b = _ref3[2];
}

if (gray) {
var _ref4 = [r * 0.21 + g * 0.72 + b * 0.07, r * 0.21 + g * 0.72 + b * 0.07, r * 0.21 + g * 0.72 + b * 0.07];
r = _ref4[0];
g = _ref4[1];
b = _ref4[2];
}

if (saturation < 1) {
var avg = (r + g + b) / 3;
r += (avg - r) * (1 - saturation);
Expand Down
2 changes: 1 addition & 1 deletion dist/vintage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0152112

Please sign in to comment.