'Multicolor SF Symbol in macOS 11 Big Sur

I want to programmatically add to the toolbar the "star.fill" symbol in multicolor yellow mode.

I can do it via Xcode/IB properties.

enter image description here

But I don't understand how to do it programmatically, because NSSymbolConfiguration - configurationPreferringMulticolor is only added in macOS 12 Monterey and doesn't work in Big Sur.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source