def apply_color(self, arr, state):
        """Apply color formula to an array."""
        ops = self.cmd(state)
        for func in parse_operations(ops):
            arr = func(arr)
        return arr
Apply color formula to an array.