Last active
August 29, 2015 14:25
-
-
Save yannickl/20c4dc43fcd05e084239 to your computer and use it in GitHub Desktop.
DynamicColor Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let adjustHueColor = baseColor.adjustedHueColor(45 / 360) | |
let complementColor = baseColor.complementColor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lighterColor = baseColor.lighterColor() | |
// equivalent to | |
// lighterColor = baseColor.lightenColor(0.2) | |
let darkerColor = baseColor.darkerColor() | |
// equivalent to | |
// darkerColor = baseColor.darkenColor(0.2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let invertColor = baseColor.invertColor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mixWithBlueColor = baseColor.mixWithColor(UIColor.blueColor()) | |
// equivalent to | |
// mixWithBlueColor = baseColor.mixWithColor(UIColor.blueColor(), weight: 0.5) | |
let mixWithRedColor = baseColor.mixWithColor(UIColor.redColor()) | |
// equivalent to | |
// mixWithRedColor = baseColor.mixWithColor(UIColor.redColor(), weight: 0.5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let saturatedColor = baseColor.saturatedColor() | |
// equivalent to | |
// saturatedColor = baseColor.saturateColor(0.2) | |
let desaturatedColor = baseColor.desaturatedColor() | |
// equivalent to | |
// desaturatedColor = baseColor.desaturateColor(0.2) | |
let grayscaleColor = baseColor.grayscaledColor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tintColor = baseColor.tintColor() | |
// equivalent to | |
// tintColor = baseColor.tintColor(amount: 0.2) | |
let shadeColor = baseColor.shadeColor() | |
// equivalent to | |
// shadeColor = baseColor.shadeColor(amount: 0.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment