I did this some time ago for a photography website with a fullscreen slider. There’s nothing built in to Kirby, but it’s only a few lines of code…
PHP’s imagecolorat() returns the rgb value of a certain pixel of an image. If you loop over the image’s pixels and calculate each pixel’s luminance, e. g. using the formular from this article, and divide their sum by the total number of pixels, you’ll get the image’s average luminance (from 0 to 255).
Looping over all pixels is probably not very efficient, especially not if you are doing this on every request.
Resampling the image to 1x1 pixels and getting the luminance from it should work fine (if you cache the result). But keep in mind that this doesn’t check for a specific image region but for the whole image. Images with dark and bright parts won’t work.