Different color pills

When you are on birth control and taking the last row of different color pills, as in when you are on your period or about to start or end it, are you still protected from pregnancy since they are just sugar pills?