Cycling through screen brightness

I’d like to cycle through the min to max screen brightness to find the median pupil size per person in a pupillometry experiment (maximizing dynamic range in constriction or dilation of the eye). Then of course I’d like to keep the brightness at the level that evokes the median pupil size per person at the start of the experiment.

Does anyone know how I’d go about doing this? Thanks!

Solution in case anyone was wondering, though now I realize that this was a bit of a basic question. I just modified the luminance axis in dkl space according to a sinusoidal pattern.