File tree 2 files changed +31
-8
lines changed
2 files changed +31
-8
lines changed Original file line number Diff line number Diff line change 1
1
# PaletteGenerator
2
+ This tool helps:
3
+ - Use Figma API to fetch [ colors data] ( #Figma-API-fetcher )
4
+ > Styles library should be published to enable API usage
5
+ - Rearrange it in case you have light/dark mode values
6
+ - [ Generate] ( #Swift-CodeGen ) swift file from fetched data
2
7
3
- A description of this package.
8
+ ## Quick Start
9
+
10
+ - Start with adding all required [ values] ( tools/README.md )
11
+ - Compile script with ` ./buildGenerator.sh `
12
+ - Execute ` ./PaletteGenerator `
13
+
14
+ ## Figma API fetcher
15
+
16
+ [ Details here] ( tools/README.md )
17
+
18
+ ## Swift CodeGen
19
+ This stage generates swift file with colors values enum using Stencil.
20
+ It takes data from Figma API fetcher output JSON.
21
+
22
+ You can check templates for generator [ here] ( Project/Sources/PaletteGenerator/Stencils )
Original file line number Diff line number Diff line change
1
+ # Figma API fetcher
2
+
3
+ ## Values
4
+ - ` io_helpers.JSON_FILE_NAME ` - name of output JSON file
5
+ - ` figma_api.FIGMA_FILE_NAME ` - Figma file name. Can be obtained from https://www.figma.com/file/ <FIGMA_FILE_NAME>/
6
+ - ` figma_api.FIGMA_TOKEN ` - Figma API token. Can be obtained from https://www.figma.com/developers/api#access-tokens -> * + Get personal access token*
7
+
8
+ > Color token name structure is described [ here] ( sources/token_name_parser.py ) and can be updated for your needs
9
+
1
10
## Quick Start
2
11
3
- Script ` colors_generator.py ` will
4
- - Get list of styles from FIGMA SPECS
12
+ Execute script ` colors_generator.py ` :
13
+ - Get list of styles from your Figma file
5
14
- Parse styles and convert them to JSON file using following format:
6
15
7
16
Solid color:
@@ -43,8 +52,3 @@ Gradient color:
43
52
}
44
53
}
45
54
```
46
-
47
- ## Values
48
- - ` io_helpers.JSON_FILE_NAME ` - name of output JSON file
49
- - ` figma_api.FIGMA_FILE_NAME ` - Figma file name. Can be obtained from https://www.figma.com/file/ <FIGMA_FILE_NAME>/
50
- - ` figma_api.FIGMA_TOKEN ` - Figma API token. Can be obtained from https://www.figma.com/developers/api#access-tokens -> * + Get personal access token*
You can’t perform that action at this time.
0 commit comments