Hi There,
Sorry, I did not realize you were using the header builder the provided code would work just for X legacy header.
While this is certainly something that is not possible out of the box with the header and footer builders, it is intentional. In spending time with the new builders, you’ve undoubtedly seen first-hand the level of granularity given to users in choosing how to style elements at all levels. However, we have also taken time to not just throw a bunch of “low-level” options at people and call it a day. Everything is curated and designed in a way to give maximum customizability while also keeping the option set as manageable as possible.
To achieve the exact effect you’re speaking to, where a bar starts transparent, and then changes to a background color on scroll with a different logo, we would essentially have to offer two sets of base and interaction styles for every element you work with in a header.
All that being said, there are certainly some alternatives you can explore to achieve this effect. 
-
When you have finished your bar, you can duplicate it, and set the second bar to be sticky and have a delayed reveal. This recreates the general effect minus the transition of the colors all happening inline. This was where we landed at for ourselves as a happy medium without bloating out the product for this one specialized effect.
-
The effect you’re going for is also easily achievable with a little custom CSS if you’re feeling up to it.
When sticky bars become fixed, they have an “x-bar-fixed” class applied to them. You could use this class to style your own set of colors that should change on scroll very easily via your custom CSS inputs in the theme, or via a child theme.
Hopefully all of that helps to give a little more context on this. Thanks!