Back to Plugins

Color2Code
Export color variables into iOS & Android code format or Xcode Color Assets
code exportandroidiostokenscollectionvariablesxcodeassetscodeexportcolordev modecode-generators
Plugin Preview
About this plugin
This plugin exports color variables into iOS & Android code format and also exports as Xcode Color Assets.
Features
------------------------------------------
- Exports iOS code format
- Exports Xcode Color assets
- Exports Android code format (Compose & XML)
- Supports variable mode (Light/Dark & High Contrast modes)
- Customize exported variable name
- Works in Dev Mode
⚠️ Important Note
------------------------------------------
Before exporting color assets;
- You should rename your modes' names to "Light" and "Dark."
- The names for the high contrast modes should be "Light High Contrast" and "Dark High Contrast."
Variable
primary-color: #18B968;
Output for iOS
let primaryColor: UIColor = UIColor(UIColor(red: 24, green: 185, blue: 104))
Output for Android Compose
val primaryColor = Color(0xff18b968)
Output for Android XML
<color name="primaryColor">#ff18b968</color>
How to use
- Launch the plugin
- Select your collection
- Hit the “Generate” button
- Copy code format
Exporting Xcode Color Assets
- Enable "Export Xcode Color Assets" option
- Hit the “Generate” button
- Download
fileName_Colors.zip
file - Drag and drop the folders in Xcode's
Assets.xcassets
Customization
- Remove group names: Removes group name from the variable name.
- Camel case naming: Removes space, dash, and underscore from the variable name.
- Ignore hierarchy: Available for exporting Xcode color assets. Ignores group hierarchy and creates color assets at the same level. If you have variables with the same name, this will export only one of them!
- Color Space: Available for exporting Xcode color assets. Display P3, sRGB, Extended Range sRGB, and Extended Range Linear sRGB options are supported.
- Input Method: Available for exporting Xcode color assets. Floating Point (0.0-0.1), 8-bit (0-255), and 8-bit Hexadecimal formats are supported.
- Any Appearance: Available for exporting Xcode color assets.
------------------------------------------
For support
------------------------------------------
Plugin Details
Version | 8 |
---|---|
Created | July 17, 2023 |
Last Updated | January 23, 2024 |
Category | Software development |
Creator | Burak |
Stats | 277 installs, 45 likes |
Pricing | Free |
Technical Details
- API:1.0.0
- UI:dist/ui.html
- main:dist/code.js
- Editor Types:figma
- Allowed Domains:
- none
More Like This
Discover other plugins in the Software development category.