Skip to content

v1.3.0

Choose a tag to compare

@2dubu2dubu released this 02 May 05:19
· 55 commits to main since this release
2fa88fd

PaletteKit v1.3.0 Release Notes

Highlights

  • PaletteColor conforms to SwiftUI's ShapeStyle (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's UIColor.init(_ color: Color) pattern) and a direct paletteColor.cgColor accessor for Core Graphics drawing — no UIColor round-trip.
  • README + DocC reorganized with platform-tabbed SwiftUI / UIKit examples so users find their pattern at a glance.

Library changes

  • PaletteExtractor's PaletteColor resolves to Color.Resolved tagged sRGB. Color.Resolved is 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.cgColor uses CGColor(srgbRed:green:blue:alpha:) directly (no UIColor allocation in the path).
  • Display P3 fidelity stays sRGB in this release. Wide-gamut rendering is earmarked for v1.4 alongside PaletteKitCard graphics work.
  • paletteKitVersion = "1.3.0".

Breaking changes

  • PaletteColor.swiftUI removed. Migrate by passing PaletteColor directly to any ShapeStyle-accepting modifier.
  • PaletteColor.uiColor removed. Migrate by using UIColor(paletteColor) or paletteColor.cgColor in 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 extraction

Roadmap

  • 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) and PaletteKitInsights (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.