Inverting a UIColor

More safekeeping than anything else (and because I didn’t see it online anywhere):

Super simple method that’s surprisingly useful if you have something like different themes in an app.

2 thoughts on “Inverting a UIColor”

  1. Mike says:

    your code is wrong.
    red, green, blue, alpha are in the range 0~1
    and you are subtracting 255.

    you have to subtract 1.

    1. Tarik Fayad says:

      You’re 100% right. Thank you for pointing that out!

Leave a Reply

Your email address will not be published. Required fields are marked *