Take opacity into account when calculating contrast ratio