Skip to content

Latest commit

 

History

History
54 lines (48 loc) · 1.29 KB

README.md

File metadata and controls

54 lines (48 loc) · 1.29 KB

Figma API fetcher

Values

Color token name structure is described here and can be updated for your needs

Quick Start

Execute script colors_generator.py:

  • Get list of styles from your Figma file
  • Parse styles and convert them to JSON file using following format:

Solid color:

{
    GroupName: {
        tokenName: {
            colors: [
                {
                    dark: HEX_RGBA,
                    light: HEX_RGBA
                }
            ],
            key: 123abc,
            style: SOLID
        }
    }
}

Gradient color:

{
    GroupName: {
        TokenName: {
            colors: [
                {
                    dark: HEX_RGBA,
                    light: HEX_RGBA
                },
                ...
            ],
            key: 123abc,
            positions: [
                < List with size == len(colors) >
            ]
            style: GRADIENT_LINEAR / GRADIENT_ANGULAR
        }
    }
}