Skip to content

Commit bde7fb2

Browse files
committed
fix color issue #30
1 parent 400e884 commit bde7fb2

File tree

6 files changed

+58
-9
lines changed

6 files changed

+58
-9
lines changed

apps/widget-demo/ios/widgetclipdemo.xcodeproj/project.pbxproj

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1212
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1313
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
14+
731843EB38574544ADBFA4E8 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D2501EF7E2347A88D6341AB /* noop-file.swift */; };
1415
96905EF65AED1B983A6B3ABC /* libPods-widgetclipdemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-widgetclipdemo.a */; };
15-
98321197BD1A4C0BA926B759 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA69F8B6C6D34E828D693E41 /* noop-file.swift */; };
1616
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
1717
XX12B55A1EDABF083C3B51XX /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = XX470101BAEB8E0BBC8B0DXX /* WidgetKit.framework */; };
1818
XX1A6800511A685AB346D2XX /* AppIntents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = XXA12889081EB894481655XX /* AppIntents.framework */; };
@@ -46,6 +46,7 @@
4646
/* End PBXCopyFilesBuildPhase section */
4747

4848
/* Begin PBXFileReference section */
49+
0E5C63F6992C48FBBF14E1C8 /* widgetclipdemo-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "widgetclipdemo-Bridging-Header.h"; path = "widgetclipdemo/widgetclipdemo-Bridging-Header.h"; sourceTree = "<group>"; };
4950
13B07F961A680F5B00A75B9A /* widgetclipdemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; fileEncoding = 4; includeInIndex = 0; path = widgetclipdemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
5051
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = widgetclipdemo/AppDelegate.h; sourceTree = "<group>"; };
5152
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = widgetclipdemo/AppDelegate.mm; sourceTree = "<group>"; };
@@ -55,10 +56,9 @@
5556
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-widgetclipdemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; fileEncoding = 4; includeInIndex = 0; path = "libPods-widgetclipdemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5657
6C2E3173556A471DD304B334 /* Pods-widgetclipdemo.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-widgetclipdemo.debug.xcconfig"; path = "Target Support Files/Pods-widgetclipdemo/Pods-widgetclipdemo.debug.xcconfig"; sourceTree = "<group>"; };
5758
7A4D352CD337FB3A3BF06240 /* Pods-widgetclipdemo.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-widgetclipdemo.release.xcconfig"; path = "Target Support Files/Pods-widgetclipdemo/Pods-widgetclipdemo.release.xcconfig"; sourceTree = "<group>"; };
59+
7D2501EF7E2347A88D6341AB /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "widgetclipdemo/noop-file.swift"; sourceTree = "<group>"; };
5860
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = widgetclipdemo/SplashScreen.storyboard; sourceTree = "<group>"; };
5961
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
60-
CA69F8B6C6D34E828D693E41 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "widgetclipdemo/noop-file.swift"; sourceTree = "<group>"; };
61-
EE95E4DAA4204C8A93E9E011 /* widgetclipdemo-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "widgetclipdemo-Bridging-Header.h"; path = "widgetclipdemo/widgetclipdemo-Bridging-Header.h"; sourceTree = "<group>"; };
6262
XX470101BAEB8E0BBC8B0DXX /* WidgetKit.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = undefined; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
6363
XX4DFF38D47332D6BF0183XX /* SwiftUI.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = undefined; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
6464
XXA12889081EB894481655XX /* AppIntents.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = undefined; lastKnownFileType = wrapper.framework; name = AppIntents.framework; path = System/Library/Frameworks/AppIntents.framework; sourceTree = SDKROOT; };
@@ -133,8 +133,8 @@
133133
13B07FB61A68108700A75B9A /* Info.plist */,
134134
13B07FB71A68108700A75B9A /* main.m */,
135135
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
136-
CA69F8B6C6D34E828D693E41 /* noop-file.swift */,
137-
EE95E4DAA4204C8A93E9E011 /* widgetclipdemo-Bridging-Header.h */,
136+
7D2501EF7E2347A88D6341AB /* noop-file.swift */,
137+
0E5C63F6992C48FBBF14E1C8 /* widgetclipdemo-Bridging-Header.h */,
138138
);
139139
name = widgetclipdemo;
140140
sourceTree = "<group>";
@@ -357,7 +357,7 @@
357357
files = (
358358
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
359359
13B07FC11A68108700A75B9A /* main.m in Sources */,
360-
98321197BD1A4C0BA926B759 /* noop-file.swift in Sources */,
360+
731843EB38574544ADBFA4E8 /* noop-file.swift in Sources */,
361361
);
362362
runOnlyForDeploymentPostprocessing = 0;
363363
};
@@ -547,6 +547,8 @@
547547
XX2638145AAD3C31E3D763XX /* Release */ = {
548548
isa = XCBuildConfiguration;
549549
buildSettings = {
550+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = $accent;
551+
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = $widgetBackground;
550552
CLANG_ANALYZER_NONNULL = YES;
551553
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
552554
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -583,6 +585,8 @@
583585
XXF46DABD2EDBAFE170DDCXX /* Debug */ = {
584586
isa = XCBuildConfiguration;
585587
buildSettings = {
588+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = $accent;
589+
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = $widgetBackground;
586590
CLANG_ANALYZER_NONNULL = YES;
587591
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
588592
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors": [
3+
{
4+
"color": {
5+
"color-space": "display-p3",
6+
"components": {
7+
"red": 0.27450980392156865,
8+
"green": 0.5098039215686274,
9+
"blue": 0.7058823529411765,
10+
"alpha": 1
11+
}
12+
},
13+
"idiom": "universal"
14+
}
15+
],
16+
"info": {
17+
"version": 1,
18+
"author": "expo"
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors": [
3+
{
4+
"color": {
5+
"color-space": "display-p3",
6+
"components": {
7+
"red": 0.11764705882352941,
8+
"green": 0.5647058823529412,
9+
"blue": 1,
10+
"alpha": 1
11+
}
12+
},
13+
"idiom": "universal"
14+
}
15+
],
16+
"info": {
17+
"version": 1,
18+
"author": "expo"
19+
}
20+
}

apps/widget-demo/targets/widget/expo-target.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ module.exports = (config) => ({
66
entitlements: {
77
/* Add entitlements */
88
},
9+
colors: {
10+
$accent: "steelblue",
11+
$widgetBackground: "dodgerblue",
12+
},
913
});

packages/apple-targets/src/withWidget.ts

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ const withWidget: ConfigPlugin<Props> = (config, props) => {
373373
type: props.type,
374374
teamId: props.appleTeamId,
375375

376+
colors: props.colors,
376377
exportJs:
377378
props.exportJs ??
378379
// Assume App Clips are used for React Native.

packages/apple-targets/src/withXcodeChanges.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export type XcodeSettings = {
5757

5858
hasAccentColor?: boolean;
5959

60-
colors?: Record<string, string>;
60+
colors?: Record<string, any>;
6161

6262
teamId?: string;
6363

@@ -765,7 +765,7 @@ function getDeviceFamilyBuildSettings(
765765
};
766766
}
767767

768-
function createConfigurationList(
768+
function createWidgetConfigurationList(
769769
project: XcodeProject,
770770
{
771771
name,
@@ -869,7 +869,7 @@ function createConfigurationListForType(
869869
props: XcodeSettings
870870
) {
871871
if (props.type === "widget") {
872-
return createConfigurationList(project, props);
872+
return createWidgetConfigurationList(project, props);
873873
} else if (props.type === "action") {
874874
return createExtensionConfigurationListFromTemplate(
875875
project,

0 commit comments

Comments
 (0)