Skip to main content

Napacitor CLI - nap assets

Apply app icons, splash screens, and theme colors to the MAUI host project. Napacitor has no image pipeline of its own: assets are declared in napacitor.config.json and the actual per-platform bitmaps are produced at build time by MAUI Resizetizer.

npx nap assets [maui]

Behavior:

  • Reads the assets section of napacitor.config.json.
  • Writes MauiIcon / MauiSplashScreen properties (Color, ForegroundFile, BaseSize) into the host App.csproj.
  • Injects color resources (from assets.colors) into Resources/Styles/Colors.xaml.
  • Idempotent: safe to re-run after changing icon.svg / splash.svg or colors.

Example config:

{
"assets": {
"sourceDir": "assets",
"icon": "icon.svg",
"iconForeground": "icon-fg.svg",
"iconColor": "#1E88E5",
"splash": "splash.svg",
"splashColor": "#FFFFFF",
"splashBaseSize": "128,128",
"colors": {
"Primary": "#1E88E5"
}
}
}

See Splash screens and icons for the full workflow.