Docs

Advent · Day 16

This one opens on December 16.

Every door opens at midnight Pacific.

See the calendar

DyeGames

Install and make Dye yours, the puzzle game in SwiftUI + Metal. Version 1.0.0.

A flood-fill puzzle about dyeing cloth: each dip turns the dyed region a new colour and it takes over every patch of that colour it touches, in three skins that each change the whole game. This guide takes you from download to a running game under your own name. It covers version 1.0.0. See the screens on its game page.

Requirements

  • Xcode 26 and an iOS 17.0 or later deployment target
  • Tuist 4 (brew install tuist)
  • An Apple Developer team for devices, Game Center, iCloud and the widget. The simulator runs without one.

Install

Download

Included with Games. Not signed in? The button takes you to sign in or create an account, then starts the download when you're back. Unzip the archive; it contains one folder, Dye/.

Make it yours

cd Dye
scripts/setup.sh --name YourGame --bundle-id com.you.yourgame --preset bandhani

The script renames the target, scheme and bundle ids, rewrites the StoreKit product ids, sets the starting preset and runs tuist generate. To keep the name Dye for now, run tuist generate instead.

Run it

Open YourGame.xcworkspace, choose an iPhone simulator and run the YourGame scheme. The scheme uses Configuration/Products.storekit, so the shop works before App Store Connect is set up.

What's in the project

  • Content: 60 levels
  • Game Center: 2 leaderboards, 10 achievements
  • Shop: Hint packs, Tip jar
  • Built on: GameCore, Feel, GameServices, GameUI
  • Presets: indigo, bandhani, swatch
  • Swift: 3,470 lines in 33 files

How Dye plays

  1. Tap a dye (or any patch on the cloth) to dip the dyed region into that colour. The dye soaks outward ring by ring into every joined patch of that colour.
  2. Each dip counts. Dipping into the colour the region already is does nothing and isn't counted.
  3. The cloth is done when every patch is one colour. Run out of dips first and you can undo or rinse and try another order.
  4. Finish at or under par (the built-in dyer's count) for three stars. Undo is free and gives the dip back; a hint makes the dyer's next dip and costs a star.

Cloth n grows from 7 × 9 in four dyes to 10 × 14 in five (Catalog.shape(for:)). The next cloth opens when you finish one, and each chapter opens with half the stars of the one before. Today's cloth (Daily) is 9 × 12 in five dyes and builds a streak.

The three skins

Each skin has its own title, play and win screen, not just its own colours. All three are free and switch live in Settings.

SkinTitlePlayWin
Indigo (default)Today's cloth laid crooked on undyed cotton under a serif wordmarkFive blues and a madder red with shibori resist marks; the dyed region turns deep indigo; round dye wells along the bottomThe cloth dyed through, "Indigo through"
BandhaniA large wordmark over a fringed cloth tied in rings of white dotsBrass bowls on an arc, the raised bowl is the current dye; a dotted badge counts the dips leftThe cloth folded into a stack with a card tag, named for its dye
SwatchA fan of test strips and a lab spec tableThe cloth as a test swatch on white card with column letters, a rack of test tubes labelled C M Y K V, a cover readout and barA lab report with a red PASS stamp

What's inside

FolderWhat
Modules/GameCoreGame-agnostic pieces: SplitMix64 and the day clock.
Modules/DyeKitThe game in plain Swift (Foundation only): the flood (region and dip), the dyer (a deterministic beam search that sets par), the cloth maker (clumped patches from a seed), the 60-cloth catalog and today's cloth, the round (dip, undo, hints, stars), the save with merge, Game Center goals, product ids and sound and haptic cues.
Modules/DyeDesignThe three skins' colours, dye names and fonts (DyeTheme) and the buttons each skin draws its own way.
Modules/DyeFeelVatSynth (drops, bubbles that climb a scale with the size of a spread, and struck bowls, all synthesized) and the AVAudioEngine and Core Haptics players.
Modules/GameServicesGame-agnostic Game Center, the iCloud key-value mirror and the StoreKit 2 storefront.
Modules/DyeUIThe session and every screen: the cloth painter with the soak animation, the vats, each skin's title, play and win screens, the cloths list, settings and the shop.
App, WidgetApp entry and service wiring; a Home Screen widget with today's cloth as you left it and your streak.
Tests, UITestsXCTest for the catalog (every cloth finishable within its count by the dyer's own path), the flood, rounds, undo, hints, saves, merges and the synth; XCUITest dips a cloth in every skin and visits the menus.

Rebrand options

  • Look: every colour, dye name and font is in DyeTheme (Modules/DyeDesign/Sources/Theme.swift). The cloth painter and vats are in Modules/DyeUI/Sources/ClothView.swift and each skin's screens in its own file.
  • Cloths: sizes, dyes, spare dips and the daily cloth are in Catalog.swift; par in Cloth.swift (Dyer) and stars in Round.swift. Numbers are in BALANCE.md.
  • Store: product ids follow the prefix from setup.sh (Products).
  • Game Center: GAMECENTER.md lists every id to create.

Tests

DyeTests checks every shipped cloth (never starts dyed, finishable by the dyer's path within its limit at three stars), the flood, dips that don't count, undo, running out, hints that always finish, unlocks, streaks, merges and that every sound renders. DyeUITests launches with -SPFreshSave -SPNoGameCenter -SPDay 14 and plays. The pure modules also build on Linux with SwiftPM.

Launch arguments for screenshots: -SPScreen title|cloths|play|win, -SPSkin indigo|bandhani|swatch, -SPDay <n>, -SPSkipOnboarding, -SPNoGameCenter.

Accessibility

Every dye is named for VoiceOver, with how many patches a dip would add. The cloth reads out how much is dyed, the dips left are always written out, and every control is labelled. Indigo and Bandhani mark patches with resist marks and tie dots as well as colour, and Swatch labels its tubes with letters. Type scales with Dynamic Type.

Changelog

1.0.0

2026-12-16

  • A flood-fill puzzle about dyeing cloth: each dip turns the dyed region a new colour and it takes over every neighbouring patch of that colour. Dye the whole cloth within the count.
  • 60 cloths in three chapters (First dips, Full vats, Long bolts), growing from 7 × 9 in four dyes to 10 × 14 in five, with par set by a built-in dyer and stars for finishing at or under it.
  • Today's cloth: the same for everyone each day, with a streak and a Home Screen widget that shows the cloth as you left it.
  • Three skins, all free and switched live, each with its own title, play and win screens: Indigo (shibori blues with resist marks and round dye wells), Bandhani (bright tie-dye in rings of dots with brass bowls on an arc) and Swatch (a dye lab with test tubes, a cover readout and a PASS-stamped report).
  • The dye soaks outward ring by ring. Free undo, rinse to start over, and hints that make the dyer's next dip; hint packs and a tip jar on StoreKit 2.
  • Drops, bubbles and struck bowls synthesized on the device, with bubbles that climb a scale as a dip takes more, and Core Haptics.
  • Game Center: 10 achievements and 2 leaderboards. iCloud keeps progress in step across devices.