color generation logic.