SmoothGradient helps you generate beautiful and buttery-smooth gradients. It helps you avoid gray dead zones in the middle of your gradients by interpolating colors in color spaces other than RGB.
This is a package strongly inspired by this gradient generator. You can click into the link to learn how this works.
let colors: [UIColor] = SmoothGradientGenerator()
.generate(
from: fromColor,
to: toColor,
interpolation: .hcl, // choose from hcl, hsl, hsb
precision: .high
)
Please check example playgrounds for more detail.
Simply add https://github.com/intitni/SmoothGradient
as a dependency in either Xcode or Package.swift.
MIT.