Skip to content

Instantly share code, notes, and snippets.

@sauvikatinnofied
Last active March 23, 2017 12:54
Show Gist options
  • Save sauvikatinnofied/d9a9c71fa69598535560d1fd8cda5776 to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/d9a9c71fa69598535560d1fd8cda5776 to your computer and use it in GitHub Desktop.
Color Scheme Categories
enum Color {
case theme
case border
case shadow
case darkBackground
case lightBackground
case intermidiateBackground
case darkText
case lightText
case intermidiateText
case affirmation
case negation
// 1
case custom(hexString: String, alpha: Double)
// 2
func withAlpha(_ alpha: Double) -> UIColor {
return self.value.withAlphaComponent(CGFloat(alpha))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment