recalculate opacity