Sketch ã® Color Variables ããã³ã¼ããçæãããã©ã°ã¤ã³ãä½ã£ã
æåã®ãã¼ã¸ã§ã³ã®éçºãã3ã¶æè¿ãçµã¡ã¾ãããã¿ã¤ãã«éã Sketch ã® Color Variables ããã³ã¼ããçæãã Sketch Plugin ãéçºããã®ã§ãã®ç´¹ä»ã§ãã
griffin-stewie/ColorVariablesExporter: Export all Color Variables
ä½ããããã©ã°ã¤ã³ã
ãã¶ã¤ã³ãã¼ã« Sketch ã®ãã©ã°ã¤ã³ã§ãã2020å¹´10æã«ã¢ãããã¼ãããã version 69 ã§è¿½å ããã Color Variables ã¨ãã Sketch ä¸ã§å®ç¾©ããã¦ããè²ãéçºè åãã®æ¸ãåºãããã®ãã©ã°ã¤ã³ã¯è¡ãã¾ãã
対å¿ãã©ã¼ããã
åèªèº«ã iOS app éçºè ãªã®ã§ Apple Platform ãä¸å¿ã«ä»¥ä¸ã®å½¢å¼ã«å¯¾å¿ãã¦ãã¾ãã
:::message Color Variables 㯠Sketch ä¸ã§ã°ã«ã¼ãã³ã°ãã¦ç®¡çã§ãã¾ããColor Variables ãã°ã«ã¼ãã³ã°ããã¦ããå ´åã対å¿ãã©ã¼ãããã®ã»ã¨ãã©ãé層æ§é ã«å¯¾å¿ãã¦ããªãããããã®ãã©ã°ã¤ã³ã§ã¯ããã£ã½ãåºåãæ¹ã§æååãé£çµããããã¦ãã¾ãã :::
Color Set ã®æ¸ãåºã㯠Storyboard ããè²ãåç §ããã人ãã³ã¼ãããåç §ããã人ãå©ç¨ã§ããã®ã§ãå§ãã§ããã³ã¼ããã Color Set ã使ãã«ã¯æååã§å¯¾è±¡ã®è²ãåç §ããã®ãå«ã ã£ãã®ã§ UIColor ã® Extension ãæ¸ãåºããããã«ãã¾ãããColor Set ã®æ¸ãåºãã¨åããã¦ä½¿ãå¿ è¦ãããã¾ããUIColor Extension 㯠SwiftGen ãçæãã¦ãããã³ã¼ããæ°ã«å ¥ããªãã£ãã®ã§ä½ãã¾ãããRGB ã® Hex å½¢å¼ã§ Doc ã³ã¡ã³ããæ¸ãã¦ããã®ã§è²ã®å¤ãããããããããªã¨æãã¾ãã
extension UIColor { /// #361D32 - 100% static let appKey: UIColor = UIColor(named: "app_key")! /// #543C52 - 100% static let appKeyLight: UIColor = UIColor(named: "app_key_light")! /// #F55951 - 100% static let appAccent: UIColor = UIColor(named: "app_accent")! }
color.xml ã¯ä½¿ã£ããã¨ã¯ãªãã§ãã ãã¡ãã®å®è£ ãåèã«ä½ã£ãã®ã§ãAndroid ã¢ããªã±ã¼ã·ã§ã³ã®éçºã«ä½¿ããã¨æãã¾ãã
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="app_key">#FF361D32</color> <color name="app_key_light">#FF543C52</color> <color name="app_accent">#FFF55951</color> </resources>
JSON å½¢å¼ã®æ¸ãåºãã¯ãä»ã®å½¢å¼ã§æ¸ãåºãããå ´åã®ãã¼ã¿ã¨ãã¦å©ç¨ããããã¨ãæ³å®ãã¦ç¨æãã¾ãããjq ã¨çµã¿åãã㦠CSV ã«ããã¨ããã§ãã¾ãããé層æ§é ã¯ãªãªã¸ãã«ãã¼ã¿ã®ã¾ã¾ã«ãã¦ãã¾ãã /
ãé©å®å¦çãã¦ãããã¨è¯ããã¨æãã¾ãã
{ "App/Key": "#361D32FF", "App/Key Light": "#543C52FF", "App/Accent": "#F55951FF" }
CLR ãã¡ã¤ã«ã¯ãmacOS ã® Color Picker ã§åç §ã§ããå½¢å¼ã§ããå©ç¨ç¨éã¯ãã¾ããªãããã§ãã Keynote ãä»ã®ãã¶ã¤ã³ãã¼ã«ãªã©ã«æã¡è¾¼ã¿ããã¨ãã«ä½¿ããããããã¾ããã
ãµã³ãã«
å ãã¼ã¿ã¨ãªã Sketch ãã¡ã¤ã«ã¨å ¨å½¢å¼ãæ¸ãåºãããµã³ãã«ãç½®ãã¦ããã®ã§æ°ã«ãªãæ¹ã¯ã¿ã¦ã¿ã¦ãã ããã
ãããã«
å人çã«ã¯ Sketch ãã¼ã¿ã¨ iOS ã¢ããªã±ã¼ã·ã§ã³éçºã§ã®è²ã®ããã¨ãã管çã«æ©ãã§ãã¾ãããããã«ç»å ´ãã Color Variables ã¯å¾ æã®æ©è½ã§ãããªãªã¼ã¹æã«ãã§ã« API ãæ´åããã¦ããã®ã§ããã«ãã©ã°ã¤ã³ãæ¸ããç¶æ³ã ã£ãã®ã§ããã«çæã§ããäºã«ãã³ã·ã§ã³ãä¸ãã£ãè¨æ¶ãããã¾ãã
Sketch Plugin ã®éçºã¯ç°¡åã§ãã®ã§çããããã²ãã£ã¬ã³ã¸ãã¦ã¿ã¦ãã ããã