One of the comments above mentions "the huge increase in cost" for using color in a book. The large cost increase for using color in a book was true twenty years ago. However, now the cost differential is quite modest. My book Measure, Integration & Real Analysis, which was mentioned in the question as an example of a math textbook that uses color, was published by Springer in its Graduate Texts in Mathematics series. Although the book uses color, its list price is the same or lower than other books is this series, considerably less than the list price of its (black-and-white) main competitors. Furthermore, the electronic version of this book is legally free (at https://measure.axler.net/).
The main use of color in Measure, Integration & Real Analysis is to distinguish definitions (in yellow boxes) from theorems (in blue boxes). I think this use of color to give these visual clues and the occasional mathematically significant color photos help make the book more student-friendly.