def _make_loop_cmds(self, themefile, zones, block, loop_items):
        """ Given loop-items from the theme file, return a list of loop
        commands.
        """
        loop_cmds = []
        pkt = self.cmd_packet
        for item in loop_items:
            item_type = themefile.get_action_type(item)
            item_colours = themefile.get_action_colours(item)
            if item_type == AlienFXThemeFile.KW_ACTION_TYPE_FIXED:
                if len(item_colours) != 1:
                    logging.warning("fixed must have exactly one colour value")
                    continue
                loop_cmds.append(
                    pkt.make_cmd_set_colour(block, zones, item_colours[0]))
            elif item_type == AlienFXThemeFile.KW_ACTION_TYPE_BLINK:
                if len(item_colours) != 1:
                    logging.warning("blink must have exactly one colour value")
                    continue
                loop_cmds.append(
                    pkt.make_cmd_set_blink_colour(block, zones, item_colours[0]))
            elif item_type == AlienFXThemeFile.KW_ACTION_TYPE_MORPH:
                if len(item_colours) != 2:
                    logging.warning("morph must have exactly two colour values")
                    continue
                loop_cmds.append(
                    pkt.make_cmd_set_morph_colour(
                        block, zones, item_colours[0], item_colours[1]))
            else:
                logging.warning("unknown loop item type: {}".format(item_type))
        return loop_cmds