This file contains hidden or 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
/// Get the UIColor corresponding to a CSS hex color code (RGB[A] or RRGGBB[AA]) | |
/// | |
/// - Parameter hex: A hexadecimal representation of the colou | |
/// - Returns: The UIColor represented by the hexidecimal color code, or UIColor.clear if parsing failed | |
func colorFromHexString (hex:String) -> UIColor { | |
// Remove padding, leading hash symbol etc. | |
let hex = hex.trimmingCharacters(in: NSCharacterSet.alphanumerics.inverted) | |
// Get numeric representation |
This file contains hidden or 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
/** | |
* Move in a circle without wrapper elements | |
* Idea by Aryeh Gregor, simplified by Lea Verou | |
*/ | |
@keyframes rot { | |
from { | |
transform: rotate(0deg) | |
translate(-150px) | |
rotate(0deg); |