@mekkablue had a script Report Black to White Ratios in 2015 which eventually was dropped. It is a script that I would find useful if it can be updated and added back. I don’t have the coding skills to do it myself.
That’s not an end in itself. What do you need the ratios for?
I don’t remember because it has been too long but I guess I retired the script because it was in little use and in the end it did not help much with anything anyway. My hope was that it would help you find letters that are too dark or light, but it doesn’t work that way. Eye combined with gut feeling was always better.