mix dala.icon (dala_dev v0.0.3)

Copy Markdown View Source

Generates platform icons for the current Dala project.

Must be run from the project root (the directory containing mix.exs).

mix dala.icon                              # random robot avatar
mix dala.icon --source PATH                # resize an existing image
mix dala.icon --source PATH --adaptive     # also emit adaptive Android icons
mix dala.icon --source PATH --adaptive --adaptive-bg "#E8B53C"

Output

Writes icons into the current project directory:

  • android/app/src/main/res/mipmap-*/ic_launcher.png (legacy)
  • ios/Assets.xcassets/AppIcon.appiconset/icon_*.png
  • ios/Assets.xcassets/AppIcon.appiconset/Contents.json
  • icon_source.png (1024×1024 master, only when generating)

With --adaptive, also writes:

  • android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  • android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  • android/app/src/main/res/mipmap-*/ic_launcher_foreground.png
  • android/app/src/main/res/values/ic_launcher_background.xml

Adaptive icons are what modern Android launchers (Pixel, Samsung, Moto…) expect: a foreground layer + a background colour, masked by the launcher to whatever shape it prefers (circle, squircle, teardrop). Without them, legacy icons get shrunk inside a launcher-supplied white circle.

Under the hood

mix dala.icon uses the image Elixir library (backed by libvips) to resize a 1024×1024 source PNG into every required platform size.

No external tools (ImageMagick, Xcode, etc.) are required — libvips is bundled as a precompiled NIF via the image dependency.