Neumorphic v2.4.0
Additive release. No existing public API changed — swift package diagnose-api-breaking-changes reports no breaking changes against v2.3.0.
Added
NeumorphicTheme.resolvedButtonColors(for:)is now public. Apps building their own button modifiers — a fixed-size icon button, for example — can resolve aNeumorphicButtonRolethrough the same mapping the built-in themed modifier uses, instead of switching over the role themselves.NeumorphicButtonRoleis not frozen, so a downstream exhaustive switch would stop compiling if a role is added later; resolving through this method does not.
Documentation
- The Accessibility article now covers both button roles. The shipped themes clear WCAG AA for each:
.surfaceand.accentare inverse pairs of the same two colors, measuring 5.63:1 on.standardand 14.22:1 on.highContrast. The four-colorNeumorphicThemeinitializer derives the accent pair from the surface pair, so themes built with it inherit that guarantee. - Added guidance for the six-color initializer, whose independent accent pair is easy to get wrong. A saturated fill with white text typically falls below AA —
.bluemeasures 4.02:1,.green2.22:1, and.orange2.20:1, against the 4.5:1 threshold.
Full changelog: https://github.com/gewill/neumorphic/blob/master/CHANGELOG.md