Skip to content

Commit 880ba8e

Browse files
author
bllizard22
committed
Update README file
1 parent a007ad1 commit 880ba8e

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
# 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
27

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)

tools/README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
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+
110
## Quick Start
211

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
514
- Parse styles and convert them to JSON file using following format:
615

716
Solid color:
@@ -43,8 +52,3 @@ Gradient color:
4352
}
4453
}
4554
```
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*

0 commit comments

Comments
 (0)