diff --git a/demoassets/main.js b/demoassets/main.js
index 0c31527..dfa5b89 100644
--- a/demoassets/main.js
+++ b/demoassets/main.js
@@ -151,16 +151,16 @@ $(function(){
resembleControl.repaint();
}
else
- if($this.is('#flatWithDistanceBasedIntensity')){
+ if($this.is('#flatDifferenceIntensity')){
resemble.outputSettings({
- errorType: 'flatWithDistanceBasedIntensity'
+ errorType: 'flatDifferenceIntensity'
});
resembleControl.repaint();
}
else
- if($this.is('#movementWithDistanceBasedIntensity')){
+ if($this.is('#movementDifferenceIntensity')){
resemble.outputSettings({
- errorType: 'movementWithDistanceBasedIntensity'
+ errorType: 'movementDifferenceIntensity'
});
resembleControl.repaint();
}
diff --git a/index.html b/index.html
index 59b10ec..e1131fe 100644
--- a/index.html
+++ b/index.html
@@ -98,14 +98,18 @@
+
+
-
-
+
+
-
+
+
+
diff --git a/resemble.js b/resemble.js
index 6f73d34..ce8869f 100644
--- a/resemble.js
+++ b/resemble.js
@@ -15,9 +15,9 @@ URL: https://github.com/Huddle/Resemble.js
alpha: 255
};
- function colorsDistance(c1, c2){
- return (Math.abs(c1.r - c2.r) + Math.abs(c1.g - c2.g) + Math.abs(c1.b - c2.b))/3;
- }
+ function colorsDistance(c1, c2){
+ return (Math.abs(c1.r - c2.r) + Math.abs(c1.g - c2.g) + Math.abs(c1.b - c2.b))/3;
+ }
var errorPixelTransform = {
flat : function (d1, d2){
@@ -36,7 +36,7 @@ URL: https://github.com/Huddle/Resemble.js
a: d2.a
}
},
- flatWithDistanceBasedIntensity: function (d1, d2){
+ flatDifferenceIntensity: function (d1, d2){
return {
r: errorPixelColor.red,
g: errorPixelColor.green,
@@ -44,7 +44,7 @@ URL: https://github.com/Huddle/Resemble.js
a: colorsDistance(d1, d2)
}
},
- movementWithDistanceBasedIntensity: function (d1, d2){
+ movementDifferenceIntensity: function (d1, d2){
var ratio = colorsDistance(d1, d2)/255 * 0.8;
return {
r: ((1-ratio)*(d2.r*(errorPixelColor.red/255)) + ratio*errorPixelColor.red),