是否可以从外部 xcassets 加载颜色?

Is that possible to load a color from an external xcassets?

我的意思是这个。我正在创建很多配色方案供使用。

所有的方案都是对象的主题。例如,文本标签的颜色、元素的背景颜色等。所以,我的想法是创建不同的 .xcassets。所有 .xcassets 都将具有相同名称的颜色。我切换 .xcassets 并且颜色发生变化。

有办法吗?

You cannot specify an asset catalog by name. But you can specify an asset by bundle. So you can use multiple bundles and multiple asset catalogs, one catalog per bundle. Each asset catalog in a bundle is your “external” asset catalog.

However, I would suggest using instead the power of inside one asset catalog: that way you can specify colors by names like "Theme1/red" vs "Theme2/red" and so on.