+ matched = TRUE;
+ } else if (match_c(buffer,
+ "%d,%d: (%f%%,%f%%,%f%%,%d) #%x ",
+ &col, &row,
+ &rf, &gf, &bf, &nocolor,
+ &check) ||
+ match_c(buffer,
+ "%d,%d: (%f%%,%f%%,%f%%) #%x ",
+ &col, &row,
+ &rf, &gf, &bf,
+ &check)) {
+ matched = TRUE;
+
+#define fp_fix(n) (int) (MaxRGB * (((n) > 100.0 ? 100.0 : (n)) / 100.0))
+
+ r = fp_fix(rf);
+ g = fp_fix(gf);
+ b = fp_fix(bf);
+ }
+ if ((s - t) > 8) /* 6 hex digits vs 8 */
+ check /= 256;
+ if (matched) {
+ int which, c;
+ int want_r = (check >> 16) & 0xff;
+ int want_g = (check >> 8) & 0xff;
+ int want_b = (check >> 0) & 0xff;
+
+#define fp_err(tst,ref) ((tst > MaxRGB) || ((tst - ref)*(tst - ref)) > 4)
+
+ if (fp_err(r, want_r) ||
+ fp_err(g, want_g) ||
+ fp_err(b, want_b)) {