Skip to content

jorgemartins/add-selected-colors

Repository files navigation

What is this?

This plugin is intended to automate the process of adding colors to a document palette.

Since Sketch v53, Fill presets can now be named and viewed in list so in order to use that we'd have to add colors manually as well as name them one by one.

Well, this plugin automates that process, and as a bonus you can export the same colection of colors to a JSON file to share with developers. Right now this is very opinionated and suited to how our team at Mindera work.

How

  1. Install the plugin
  2. Make sure your layers follow the name structure: something/color-value (example: colors/blue-100)
  3. (if you have colors on document colors palette, you might want to run Add selected colors to.. -> Reset Palette)
  4. select all color Layers you want to add to the palette, and run Add selected colors to.. -> Document colors
  5. Repeat 4. but choose to JSON to export the slected layers as a JSON list.

Thanks

Thanks to @helloimbguedes for cleaning up the code and the initial structure.

Thanks to dkrape for the starting point of how to approach this.

Thanks to @andrewfiorillo for Sketch Palettes which this was also based on.