v1.3.0
PaletteKit v1.3.0 Release Notes
Highlights
PaletteColorconforms to SwiftUI'sShapeStyle(iOS 17+) — pass it directly to.fill,.foregroundStyle,.background,.tint,.border, etc. without an adapter call.- UIKit gets a
UIColor(_ paletteColor:)convenience initializer (mirrors Apple'sUIColor.init(_ color: Color)pattern) and a directpaletteColor.cgColoraccessor for Core Graphics drawing — noUIColorround-trip. - README + DocC reorganized with platform-tabbed
SwiftUI/UIKitexamples so users find their pattern at a glance.
Library changes
PaletteExtractor'sPaletteColorresolves toColor.Resolvedtagged sRGB.Color.Resolvedis Apple's iOS 17+ "concrete RGBA value" type; SwiftUI's pipeline converts it without a context lookup. Apple handles the gamma decode internally.UIColor.init(_ paletteColor:)is sRGB-tagged with full opacity. Chain.withAlphaComponent(_:)for non-opaque variants.paletteColor.cgColorusesCGColor(srgbRed:green:blue:alpha:)directly (noUIColorallocation in the path).- Display P3 fidelity stays sRGB in this release. Wide-gamut rendering is earmarked for v1.4 alongside
PaletteKitCardgraphics work. paletteKitVersion = "1.3.0".
Breaking changes
PaletteColor.swiftUIremoved. Migrate by passingPaletteColordirectly to anyShapeStyle-accepting modifier.PaletteColor.uiColorremoved. Migrate by usingUIColor(paletteColor)orpaletteColor.cgColorin UIKit / Core Graphics.
Install
// Requires iOS 17+, Swift 6.0, Xcode 16+.
.package(url: "https://github.com/2dubu/PaletteKit", from: "1.3.0")Try it on your device
make demo-app # build & run on a connected iPhone or simulator
# tap the gear icon to tune extractionRoadmap
- v1.4 —
PaletteKitCard(palette-driven share-card graphics with a tier strategy: LinearGradient → MeshGradient → SwiftUI Shader → MetalKit). The natural place to revisit Display P3 fidelity in the rendering path. - v2.0 —
observe()(live video / camera) andPaletteKitInsights(FoundationModels captions, color naming, custom instructions on iOS 26+).
Acknowledgements
Thanks to color-thief by Lokesh Dhakar (MIT). v1.3 keeps full algorithm parity with v1.2's color-thief audit results.