RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
727 stars 114 forks source link

Failed when export color contain image #26

Closed lichin-lin closed 3 years ago

lichin-lin commented 3 years ago

issue

when exporting on this Figma file, it failed for image color, is there any way to ignore / skip this type of color πŸ™‚?

> figma-export colors
2020-09-22T10:25:52+0800 info: Using FigmaExport to export colors.
2020-09-22T10:25:52+0800 info: Fetching colors. Please wait...
Error: keyNotFound(CodingKeys(stringValue: "color", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "nodes", intValue: nil), _JSONKey(stringValue: "8:3", intValue: nil), CodingKeys(stringValue: "document", intValue: nil), CodingKeys(stringValue: "fills", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0)], debugDescription: "No value associated with key CodingKeys(stringValue: \"color\", intValue: nil) (\"color\").", underlyingError: nil))

version

I am using v0.13.0

subdan commented 3 years ago

What do you mean by image color?

I don't have permissions to view your file.

image

Could you give me permission to view your file?

subdan commented 3 years ago

I've understood. Image color β€” color style created from image. To ignore this type of color style you should set description of the style to none. FigmaExport doesnβ€˜t export a style when description = none.

Screen Shot 2020-09-22 at 09 51 30Screen Shot 2020-09-22 at 09 51 42

lichin-lin commented 3 years ago

@subdan oh, sorry I didn't aware the permission issue, I update the setting so you should see the file now πŸ˜…. and I've try the method you provide, it works!

just a quick question, from designer's perspective, they might not going to set "none" in the description since they will need to note down important stuff in description field, would you change the rule (for example, matching a substring "none" in the whole field)?

subdan commented 3 years ago

Good idea. I will change the rule to match a substring.

lichin-lin commented 3 years ago

thanks for the update! really like this repo!