Change from_argb_hex() (which wasn't being used) to from_rgba_hex().
authorCarl Hetherington <cth@carlh.net>
Fri, 24 Feb 2023 21:31:51 +0000 (22:31 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Feb 2023 21:31:51 +0000 (22:31 +0100)
src/colour.cc
src/colour.h

index a47e63347a1f48d035ff3574c69e678baea25b92..fc7a1fb6b3fc7d92d52380142d088955b554f760 100644 (file)
 using std::string;
 using namespace sub;
 
+
 Colour
-Colour::from_argb_hex (string argb_hex)
+Colour::from_rgba_hex(string rgba_hex)
 {
-       int alpha, ir, ig, ib;
-       if (sscanf (argb_hex.c_str(), "%2x%2x%2x%2x", &alpha, &ir, &ig, &ib) < 4) {
+       int ir, ig, ib, alpha;
+       if (sscanf(rgba_hex.c_str(), "%2x%2x%2x%2x", &ir, &ig, &ib, &alpha) < 4) {
                throw XMLError ("could not parse colour string");
        }
 
        return Colour (float (ir) / 255, float (ig) / 255, float (ib) / 255);
 }
 
+
 Colour
 Colour::from_rgb_hex (string rgb_hex)
 {
index 65660a53f05f851a6adceebc42977e6e4e73483c..241f7384035fbf2e11f8d53629314788c7eeb996 100644 (file)
@@ -47,7 +47,7 @@ public:
                , b (b)
        {}
 
-       static Colour from_argb_hex (std::string);
+       static Colour from_rgba_hex(std::string);
        static Colour from_rgb_hex (std::string);
 
        /** red component (from 0 to 1) */