summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-02-24 22:31:51 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-24 22:31:51 +0100
commita67eacd9def1b85e7dd79ec192bb975369567bd6 (patch)
tree4068b805bb0cd45431907706c9aefb916226e2f5
parent4e1a34666c7f153bd073901908c8b0ca053b4c45 (diff)
Change from_argb_hex() (which wasn't being used) to from_rgba_hex().
-rw-r--r--src/colour.cc8
-rw-r--r--src/colour.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/colour.cc b/src/colour.cc
index a47e633..fc7a1fb 100644
--- a/src/colour.cc
+++ b/src/colour.cc
@@ -25,17 +25,19 @@
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)
{
diff --git a/src/colour.h b/src/colour.h
index 65660a5..241f738 100644
--- a/src/colour.h
+++ b/src/colour.h
@@ -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) */