zeplin-extension-documentation
zeplin-extension-documentation copied to clipboard
Name of colors
I have a color in Styleguide named #black8
but a color property of a shadow or a border have undefined
name.
Example of using:
function cgColor(color, useColorNames) {
if (useColorNames && color.name) {
return "UIColor." + color.name + ".cgColor\n"
}
return uiColor(color.r, color.g, color.b, color.a) + ".cgColor\n"
}
You can get the named instance of a color object using Project.findColorEqual
if it's in the project's styleguide. Honestly, this does not seem so intuitive so I think we'll change this so that every color/textStyle properties will have their name set if they are included in the project's styleguide.
It works, thanks!
view.layer.shadowColor = UIColor.black8.cgColor