Skip to content

Instantly share code, notes, and snippets.

View mapierce's full-sized avatar
💭
🦖

Matthew Pierce mapierce

💭
🦖
View GitHub Profile
@mapierce
mapierce / UIColor+shadeAlter.swift
Last active November 15, 2019 13:11
UIColor extension to lighten and darken colours by a percentage
extension UIColor {
func darken(by percent: Float = 0.1) -> UIColor {
return alterColor(by: percent, with: -)
}
func brighten(by percent: Float = 0.1) -> UIColor {
return alterColor(by: percent, with: +)
}