
The problem
Mandala and animal line art has thousands of tiny regions. On a phone screen they are too small to hit with a finger, and the colour has to land exactly inside the lines.
What I built
- Zoomable canvas. The picture sits in a scroll view, so the finest parts can be pinched into.
- Tap mapping. The tap point is converted from the zoomed view to the bitmap pixel, so the fill lands where the finger is.
- Flood fill. The fill is the open-source UIImageScanlineFloodfill library (Objective-C, iterative scanline with a linked-list stack), bridged into the Swift app with a tolerance for anti-aliased edges.
- Palette. Preset colours plus a picker for custom colours, and a set of line-art pictures.
Stack
Swift, UIKit, an Objective-C bridging header, UIImageScanlineFloodfill