Skip to content

Releases: TomCarey/GradientKit

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 02:19
5e7c261

0.3.0 (2026-10-14)

Features

  • uikit: add start/end points to view inits and a .fade colours helper (#4) (0bd08fe)

GradientKit 0.1.0

Choose a tag to compare

@TomCarey TomCarey released this 13 Oct 05:12

First release of GradientKit: gradients for SwiftUI, UIKit and Core Graphics that blend colours better than a straight line through sRGB.

Highlights

  • Interpolation modes: .sRGB, .pythagorean (root-mean-square, the default), .oklab and .oklch with CSS-style hue directions (.shorter, .longer, .increasing, .decreasing).
  • CSS Color 4 gamut mapping for OKLab/OKLCH: keeps lightness and hue and reduces chroma, instead of clipping channels.
  • Easing curves: .ease, .easeIn, .easeOut, .easeInOut and custom .cubicBezier, applied per segment.
  • Correct transparency: premultiplied alpha in every mode, so fades to clear keep their hue.
  • SwiftUI: .interpolatedLinear, .interpolatedRadial and .interpolatedAngular shape styles, plus the exact per-pixel InterpolatedShadingView.
  • Core Graphics: InterpolatedShading builds CGShadings from a CGFunction.
  • UIKit: InterpolatedGradientView and InterpolatedGradientLayer (CAGradientLayer), with automatic dark-mode updates and axial, radial and conic types.
  • Adaptive approximation stops keep SwiftUI and Core Animation gradients within 0.002 ΔE OK of the exact curve.
  • Xcode previews for every feature, and 25 tests.

Requirements

iOS 17, macOS 14, tvOS 17, watchOS 10 or visionOS 1, with Swift 6.

.package(url: "https://github.com/TomCarey/GradientKit.git", from: "0.1.0")