I think this should be if (!a.bgIs24bit && !b.bgIs24bit), right?