+ clr_tbl[key] = clr_data;
+ }
+
+ /*
+ * Modify colour entries with RGB = (255,0,255) to (255,0,254) if
+ * mask colour is present (so that existing pixels with (255,0,255)
+ * magenta colour are not incorrectly made transparent):
+ */
+ if (hasMask)
+ {
+ for (it = clr_tbl.begin(); it != clr_tbl.end(); it++)
+ {
+ if (it->second.R == 255 && it->second.G == 0 &&
+ it->second.B == 255 &&
+ it->first != maskKey)
+ {
+ it->second.B = 254;
+ }
+ }