Created
September 27, 2018 19:23
-
-
Save neilkimmett/d860c9a6d4564abdb05a0d97202ada3f to your computer and use it in GitHub Desktop.
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
const colors = result | |
.get('props') | |
.map(prop => { | |
const { r, g, b, a } = tinycolor(prop.get('value')).toRgb();; | |
return ` @objc static let ${prop.get('name')} = #colorLiteral(red: ${parseFloat(r)/255.0}, green: ${parseFloat(g)/255.0}, blue: ${parseFloat(b)/255.0}, alpha: ${parseFloat(a)})`; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment