0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-06 23:00:55 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotRectangle.ts

17 lines
514 B
TypeScript
Raw Normal View History

import { PenpotFile } from '@ui/lib/penpot';
import { RECT_TYPE } from '@ui/lib/types/rect/rectAttributes';
import { RectShape } from '@ui/lib/types/rect/rectShape';
2024-04-15 07:03:30 -05:00
import { translateFillGradients, translateUiBlendMode } from '@ui/translators';
2024-04-08 10:50:01 -05:00
2024-04-15 07:03:30 -05:00
export const createPenpotRectangle = (
file: PenpotFile,
{ type, fills, blendMode, ...rest }: RectShape
) => {
file.createRect({
type: RECT_TYPE,
fills: translateFillGradients(fills),
2024-04-15 07:03:30 -05:00
blendMode: translateUiBlendMode(blendMode),
...rest
2024-04-08 10:50:01 -05:00
});
};