Update for modus-themes v4 and mlscroll.el Colors

Early this year, I wrote about my upgrade to modus-themes v4.x and how I used a custo mechanism to style the scroll bar indicator I like using, mlscroll.el, so that it looks nice.

This week, J.D. Smith, author of mlscroll.el, pointed out that mlscroll.el’s color declarations nowadays allow you to specify nil to inherit the color of the scroll-bar face (aka color settings).

That means I can delete all this:

(with-eval-after-load 'modus-themes
  (with-eval-after-load 'mlscroll
    (defun ct/modus-themes-mlscroll-colors ()
      "Update `mlscroll' colors and restart `mlscroll-mode'."
      (modus-themes-with-colors
        (customize-set-variable 'mlscroll-in-color blue-faint)
        (customize-set-variable 'mlscroll-out-color bg-main))
      (when mlscroll-mode
        (mlscroll-mode -1)
        (mlscroll-mode +1)))
    (add-hook 'modus-themes-after-load-theme-hook #'ct/modus-themes-mlscroll-colors)))

Then mlscroll-in-color and mlscroll-out-color are nil by default and inherit the scroll bar colors.

But of course I don’t like the modus-themes’s default scroll bar colors. So I’ve essentially added the following instead:

(with-eval-after-load 'modus-themes
  (defun ct/modus-themes-customize-scroll-bar-face ()
    "Update `scroll-bar' foreground and background colors."
    (modus-themes-with-colors
      (custom-set-faces
       `(scroll-bar ((,c :foreground ,blue-faint :background ,bg-main))))))
  (add-hook 'modus-themes-after-load-theme-hook #'ct/modus-themes-customize-scroll-bar-face))

I like my blues as control colors on macOS. I’m too color blind to tell you what the original color actually was, but it wasn’t blue!