Repository navigation
Releases: TomCarey/GradientKit
Releases · TomCarey/GradientKit
Release list
v0.3.0
GradientKit 0.1.0
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),.oklaband.oklchwith 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,.easeInOutand custom.cubicBezier, applied per segment. - Correct transparency: premultiplied alpha in every mode, so fades to clear keep their hue.
- SwiftUI:
.interpolatedLinear,.interpolatedRadialand.interpolatedAngularshape styles, plus the exact per-pixelInterpolatedShadingView. - Core Graphics:
InterpolatedShadingbuildsCGShadings from aCGFunction. - UIKit:
InterpolatedGradientViewandInterpolatedGradientLayer(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")