>>107853099
Maybe there is a way to automatically do that, but the results will be pretty bad, like >>107850751 said. I think it would be better to do it manually for each theme. modus-themes provides a couple of bg-<color> color values that are good for this. For standard-light theme it would be something like
(modus-themes-with-colors
(custom-set-faces
`(font-lock-keyword-face
((,c :foreground ,fg-main :background ,bg-magenta-subtle)))
`(font-lock-function-name-face
((,c :foreground ,fg-main :background ,bg-blue-subtle)))
`(font-lock-string-face
((,c :foreground ,fg-main :background ,bg-red-subtle)))
`(font-lock-comment-face
((,c :foreground ,fg-main :background ,(color-lighten-name red-faint 100))))))
and so on for each font-lock face, adjusting each color to your liking with `color-lighten-name' or `color-desaturate-name' for example.