A microfluidic device is used to generate a complex gradient of diffusible molecules in a static solution. The gradient is precise and steady both in space and in time. This device, made from poly(dimethylsiloxane), consists of three layers. The molecules in reservoirs on the top layer diffuse through the flat middle layer of hydrogel and reach an equilibrium distribution. Microfluidic channels on the bottom layer that are in close contact with the hydrogel contain free solution that has concentration gradients based on the gradient in the gel. The gradient profile in the channel can be designed to have an arbitrary form (within the range of the existing gradient in the hydrogel) by controlling the local direction of the channel at each point.