I need help in the following, I am trying to make all pages facing the chapter openings contain a gray of x% when they do not contain text (exclusive condition) only for the mainmatter section. The frontmatter and the backmatter are excluded from this condition.
the image below shows the result in two openings
I get this result by reviewing the opening of each chapter and placing the instruction at the end of the chapter
and then at the beginning of the chapter
to retake the color white
But what I am looking for is that this can be achieved automatically, since it is common to modify the texts and the box widths, which leads to having to constantly check the chapter openings