First I have to mention that I have _not_ coded anything that works exactly that way but an idea come to mind.
That scrollbar seems to use the WS_EX_LAYERED along with a NULL_BRUSH as its background, either that or a combination of WS_EX_COMPOSITED and WS_EX_TRANSPARENT.
Presuming it is using WS_EX_LAYERED (most likely), the WS_EX_LAYERED causes Windows to blend whatever is shown in the window, scrollbar in this case, to be blended with whatever is behind it.
the NULL_BRUSH causes any unpainted portions of the scrollbar to effectively be transparent. (blending a null brush with "anything that's behind it" will yield the "anything that's behind it".
The change in darkness is likely caused by simply painting a darker shade of grey. Windows will blend it automatically with whatever is behind it.
Note that using the WS_EX_LAYERED that way is only supported on Windows 8 and above. On previous versions of Windows that support that extended style, it can only be used on the top level windows and the scrollbar isn't one.
I don't have an example of using WS_EX_LAYERED but, there is an example for a somewhat related question on stackoverflow at
https://stackoverflow.com/questions/3970066/creating-a-transparent-window-in-c-win32 the last portion of the example code applies to painting/repainting the scrollbar you want.
HTH.