This is indeed a lot cleaner, however that would mean you'd get the actual colors of the buttons (which for all the buttons except the black one would be bootstrap colors, and thus not exactly "regular" blue/green/yellow etc. 
I guess this wouldn't really matter that much though, as it's an example.

I could of course also change the actual button colors too, but since you then need to change hover, stroke and background to suitable colors your solution would probably be better.