fix crash when copy'ing latent plugins
[ardour.git] / libs / canvas / colors.cc
index 19c522664297276a6940e815f0b79469c157f56b..7a108e7f85a36bd4aad3380478df053f9a0228f3 100644 (file)
@@ -259,6 +259,7 @@ HSV::HSV (const std::string& str)
 string
 HSV::to_string () const
 {
+       PBD::LocaleGuard lg;
        stringstream ss;
        ss << h << ' ';
        ss << s << ' ';
@@ -596,7 +597,7 @@ SVAModifier::from_string (string const & str)
 string
 SVAModifier::to_string () const
 {
-       PBD::LocaleGuard lg ("C");
+       PBD::LocaleGuard lg;
        stringstream ss;
 
        switch (type) {
@@ -658,3 +659,10 @@ SVAModifier::operator () (HSV& hsv)  const
        return r;
 }
 
+ArdourCanvas::Color
+ArdourCanvas::color_at_alpha (ArdourCanvas::Color c, double a)
+{
+       double r, g, b, unused;
+       color_to_rgba (c, r, g, b, unused);
+       return rgba_to_color( r,g,b, a );
+}