0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-05 14:20:35 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/partials/transformBlend.ts

13 lines
453 B
TypeScript
Raw Normal View History

2024-04-15 11:18:58 -05:00
import { translateBlendMode } from '@plugin/translators';
2024-05-06 01:06:14 -05:00
import { ShapeAttributes } from '@ui/lib/types/shapes/shape';
2024-04-15 11:18:58 -05:00
export const transformBlend = (
node: SceneNodeMixin & MinimalBlendMixin
): Pick<ShapeAttributes, 'blendMode' | 'opacity'> => {
2024-04-15 11:18:58 -05:00
return {
blendMode: translateBlendMode(node.blendMode),
opacity: !node.visible ? 0 : node.opacity // @TODO: check this. If we use the property hidden and it's hidden, it won't export
};
};