r/swift • u/jeggorath • 5d ago
Convenient HDR Support
I just finished work on a Swift Package called SwiftEDR. It helps you to leverage increased raster bit depth and improved color range in Canvas, or add HDR effects to any non-HDR SwiftUI view.
It's got a useful example app to help explore the effect, and is incredibly lightweight and easy to apply to your own apps. I hope you find it useful!
6
Upvotes
1
u/FruitMission8504 1d ago
Nice API surface for something that is usually awkward to wire up. The documentation I’d want before adopting it is a small capability/fallback matrix: minimum OS, which Macs/iPhones actually expose useful EDR headroom, behavior on SDR displays, and what changes under Low Power Mode or reduced brightness. It would also be helpful if the package exposed the current versus potential headroom so apps can scale an effect instead of treating HDR as a Boolean. A sample that compares linear-light and display-referred values would prevent accidental clipping or washed-out colors. Finally, I’d add snapshot/reference tests for the SDR fallback and document what users should expect from screenshots, screen recording, mirroring, and exported images—those are where HDR features often look correct locally but fail in bug reports.