UIColor

extension UIColor
  • Returns a UIColor by interpolating between two other UIColors.

    Declaration

    Swift

    public static func interpolate(from fromColor: UIColor, to toColor: UIColor, with progress: CGFloat) -> UIColor

    Parameters

    fromColor

    The UIColor to interpolate from

    toColor

    The UIColor to interpolate to (e.g. when fully interpolated)

    progress

    The interpolation progess; must be a CGFloat from 0 to 1

    Return Value

    The interpolated UIColor for the given progress point