diff --git a/Sources/XcodeExport/Resources/Color+extension.swift.stencil b/Sources/XcodeExport/Resources/Color+extension.swift.stencil index fd87d6a1..adbc875a 100644 --- a/Sources/XcodeExport/Resources/Color+extension.swift.stencil +++ b/Sources/XcodeExport/Resources/Color+extension.swift.stencil @@ -13,7 +13,7 @@ private class BundleProvider { static let bundle = Bundle(for: BundleProvider.self) } {% endif %} -public extension Color {{ "{" }}{% for color in colors %} +public extension ShapeStyle where Self == Color {{ "{" }}{% for color in colors %} static var {{ color.name }}: Color { Color({% if useNamespace %}"{{ color.originalName }}"{% else %}#function{% endif %}{% if not assetsInMainBundle %}, bundle: BundleProvider.bundle{% endif %}) }{% endfor %} } {% include "Bundle+extension.swift.stencil.include" %} \ No newline at end of file diff --git a/Tests/XcodeExportTests/XcodeColorExporterTests.swift b/Tests/XcodeExportTests/XcodeColorExporterTests.swift index fb087486..5fb1877e 100644 --- a/Tests/XcodeExportTests/XcodeColorExporterTests.swift +++ b/Tests/XcodeExportTests/XcodeColorExporterTests.swift @@ -237,7 +237,7 @@ final class XcodeColorExporterTests: XCTestCase { static let bundle = Bundle(for: BundleProvider.self) } - public extension Color { + public extension ShapeStyle where Self == Color { static var colorPair1: Color { Color(#function) } static var colorPair2: Color { Color(#function) } } @@ -274,7 +274,7 @@ final class XcodeColorExporterTests: XCTestCase { static let bundle = Bundle.module } - public extension Color { + public extension ShapeStyle where Self == Color { static var colorPair1: Color { Color(#function, bundle: BundleProvider.bundle) } static var colorPair2: Color { Color(#function, bundle: BundleProvider.bundle) } }