FWIW, ambient light sensors were present in (high end) devices (and displays) for ages, but they never worked reasonably on desktop hardware: basically, they should let you configure at least two points of comfort in different lightning. Eg. when it's very dark, you set the brightness that is comfortable; when it's very bright around you, you set another level of screen brightness. Finally, display brightness gets set automatically by interpolating (and even extrapolating) from your chosen settings.
Advanced configuration could allow you to tune the curve continuously (or in a sufficient number of discreet steps that it seems to be continuous).
I think I noticed my Android phone at least doing a "I'll remember a relative brightness you want for this much light outside", though I haven't checked if it's really that.
I should have mentioned that I was thinking of a sheet of paper in the same room / with the same lightning, next to the screen we are speaking about. Otherwise, yes, indeed.
> why not just support different contrast levels
So what I understand from this is that we can't get this right (in HTML/CSS) for now because we don't have details about the environment of the user wrt lighting/contrast (preferences/perception).
It seems like something that should be fixed at the browser or the OS level. One should be able to say: "this is some black text on white background that needs to be displayed so as to be comfortable for the user given their environment" (or something). Maybe that needs to be the default by the way.
Until then, any forced value is going to suck for someone.