0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-03 13:20:37 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotPath.ts
Jordi Sala Morales 73ccf83657
Vectors - Pen & pencil (#35)
* path shapes

* add polygon node

* wip vector

* implement translation of commands and paths

* vectors and polygon

* strokes

* star

* deformed shapes

* simplify star

* simplify star

* fix transformers

---------

Co-authored-by: Alex Sánchez <sion333@gmail.com>
2024-04-16 16:08:39 +02:00

21 lines
590 B
TypeScript

import { PenpotFile } from '@ui/lib/penpot';
import { PATH_TYPE } from '@ui/lib/types/path/pathAttributes';
import { PathShape } from '@ui/lib/types/path/pathShape';
import {
translateFillGradients,
translatePathContent,
translateUiBlendMode
} from '@ui/translators';
export const createPenpotPath = (
file: PenpotFile,
{ type, fills, blendMode, content, ...rest }: PathShape
) => {
file.createPath({
type: PATH_TYPE,
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
content: translatePathContent(content),
...rest
});
};