Contents

callAsFunction(_:)

Calls the transform closure of the color transformer.

Declaration

func callAsFunction(_ input: UIColor) -> UIColor

Discussion

Using this syntax, you can call the color transformer type as if it were a closure:

let alphaColorTransformer = UIConfigurationColorTransformer() { baseColor -> UIColor in
    return baseColor.withAlphaComponent(0.5)
}

let baseColor = UIColor.red
let modifiedColor = alphaColorTransformer(baseColor)

See Also

Calling the color transformer