Allow creation of MIDI control points object tool.
[ardour.git] / libs / canvas / colors.cc
index be55d2b7e24de985b53a3d785c449425d1f5ff97..361023d300f50f861635cbe21212da77f5b1be4d 100644 (file)
@@ -376,6 +376,7 @@ HSV::delta (const HSV& other) const
                d.s = s - other.s;
                d.v = v - other.v;
        }
+       d.a = a - other.a;
        /* do not clamp - we are returning a delta */
        return d;
 }
@@ -409,15 +410,15 @@ HSV::distance (const HSV& other) const
 
        double sL, sA, sB;
        double oL, oA, oB;
-       double r, g, b, a;
+       double r, g, b, alpha;  // Careful, "a" is a field of this
        Color c; 
 
        c = hsva_to_color (h, s, v, a);
-       color_to_rgba (c, r, g, b, a);
+       color_to_rgba (c, r, g, b, alpha);
        Rgb2Lab (&sL, &sA, &sB, r, g, b);
 
        c = hsva_to_color (other.h, other.s, other.v, other.a);
-       color_to_rgba (c, r, g, b, a);
+       color_to_rgba (c, r, g, b, alpha);
        Rgb2Lab (&oL, &oA, &oB, r, g, b);
 
        // Weighting factors depending on the application (1 = default)