0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-05 06:10:52 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createRectangle.ts

18 lines
577 B
TypeScript
Raw Normal View History

2024-05-13 03:12:58 -05:00
import { PenpotFile } from '@ui/lib/types/penpotFile';
2024-05-06 01:06:14 -05:00
import { RectShape } from '@ui/lib/types/shapes/rectShape';
import { parseFigmaId } from '@ui/parser';
import { symbolBlendMode, symbolFills } from '@ui/parser/creators/symbols';
2024-04-08 10:50:01 -05:00
export const createRectangle = (
2024-04-15 07:03:30 -05:00
file: PenpotFile,
{ type, fills, blendMode, figmaId, figmaRelatedId, ...rest }: RectShape
2024-04-15 07:03:30 -05:00
) => {
file.createRect({
id: parseFigmaId(file, figmaId),
shapeRef: parseFigmaId(file, figmaRelatedId, true),
fills: symbolFills(fills),
blendMode: symbolBlendMode(blendMode),
...rest
2024-04-08 10:50:01 -05:00
});
};