Make a grid of planes fill camera view
Just like Blender Sushi Guy demonstrated with nodes, the same math can be done with driver expressions.



Add a driver to the Constant offset off an array modifier.

Add a driver to the scale (or position) of the stripes.

Create an empty to control the stripes.

To have one less variable, I set the camera as orthographic with a width of 10.

no       number of bars
gap      size of gap between bars
width    width of bars
10       total width


Fixed gap size, varying stripe width

We need to set the width, and the position of the first stripe, based on the number of stripes and the gap size.

Size (X)

(no + 1) * gap + no * width = 10

width = (10 - (no + 1) * gap) / no


Constant Offset (X)

(We have to divide through the width, since the modifier bases its offset on the width.)

[(10 - gap) / no] / width = offset
[(10 - gap) / no] / [(10 - (no + 1) * gap) / no] = offset
[(10 - gap) / no] * [no / (10 - (no + 1) * gap)] = offset
(10 - gap) / (10 - (no + 1) * gap) = offset




Fixed stripe size, varying gap width

We need to set the gap size, and the position of the first stripe, based on the number of stripes and the width of the stripes.

Location (X)

(no + 1) * gap + no * width = 10

gap = (10 - (no * width)) / (no + 1)


Constant Offset (X)

[(10 - gap) / no] / width = offset
(10 - gap) / (no * width) = offset
(10 - (10 - (no * width)) / (no + 1)) / (no * width) = offset