An Expo config plugin that lets you easily enable P3 Color Space for your app (iOS only).
📌 By default, React Native renders all colors in the sRGB color space. With this plugin, you can switch to Display P3, a wide-gamut color space to achieve richer and more vibrant colors.
- Expo SDK 53+
bun add -D expo-color-space-pluginAfter installation, run the apply command to automatically add the plugin to your Expo config:
bunx expo-color-space-plugin applyThis will:
- Detect your Expo config file (
app.json,app.config.js, orapp.config.ts) - Prompt you to choose a color space (displayP3 or SRGB)
- Automatically add the plugin to your config
You can also specify the color space directly:
bunx expo-color-space-plugin apply --colorSpace=displayP3Alternatively, you can manually add the plugin to your app.config.js/app.config.ts/app.json:
export default {
expo: {
name: "Your App",
slug: "your-app",
// ... other config
plugins: [
// ... other plugins
"expo-color-space-plugin"
// Or with custom color space:
// ["expo-color-space-plugin", { "colorSpace": "displayP3" | "SRGB" }]
]
}
}colorSpace(optional): The color space to apply. Options are:"displayP3"(default from package) - Display P3 color space for wide color gamut"SRGB"- Standard RGB color space (you get this by default without this plugin)
After adding the plugin, you need to prebuild your iOS app:
bunx expo prebuild --cleanThere's no real magic here 😅. The plugin simply adds a single line of code to your iOS AppDelegate to set the default color space.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.