Yup. Dying is part of how of figure out what isn't the correct color in the color pattern, especially necessary on the later levels.