+ channels < 3 ||
+ ref.channels < 3) {
+ return 0.0;
+ }
+
+ // Ignore missing alpha when comparing RGB w/ RGBA, but enforce an equal
+ // number of channels otherwise.
+ unsigned minChannels = std::min(channels, ref.channels);
+ if (channels != ref.channels && minChannels < 3) {