Skip to content

mail-ru-im/motli-sketch-palette

Repository files navigation

motli-sketch-palette

A tool for creating motli palette from sketch files.

How to run

You only need to provide two arguments (order matters):

  1. Path to a specially formed sketch file with a color palette;
  2. Path to a file where parsed palette will be stored (for further using with motli).

For example:

java -jar motli-sketch-palette.jar /Users/test/palett.sketch /Users/test/palette.json

Hot to create a palette

First of all take a look to the sample palette built with Sketch:

Sample palette

There are two themes left and right with 3 colors each.

Theme is represented with the vertical rectangle. The name of the rectangle MUST ends with "_theme" suffix (without quotes). In the example above left theme is called "left_theme" and right theme - "right_theme".

Color within theme is represented with the rectangle placed RIGHT INSIDE theme rectangle. The name of the rectangle MUST be written in snake-case and starts with hashtag sign. motli will transform color names to lowerCamelCase later.

You may find test-palette.sketch file with palette described above.

How it works

motli-sketch-palette tries to find shapes with names ending with "_theme" and considers them as theme-shapes. Then tries to find shapes that placed completely inside theme-shapes and considers them as colors of corresponding theme.

License

Copyright (c) 2019 Mail.Ru IM

Licensed under the MIT License.

About

A tool for creating motli palette from sketch files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages