From b338027e74a6d1715da3a532e2a55aef32ce39ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Mon, 15 Apr 2024 10:06:19 +0200 Subject: [PATCH] custom gradient --- plugin-src/translators/translateFills.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin-src/translators/translateFills.ts b/plugin-src/translators/translateFills.ts index 0abe2e9..2b6cb49 100644 --- a/plugin-src/translators/translateFills.ts +++ b/plugin-src/translators/translateFills.ts @@ -1,23 +1,23 @@ import { Fill } from '@ui/lib/types/utils/fill'; -// import { translateGradientLinearFill } from './translateGradientLinearFill'; +import { translateGradientLinearFill } from './translateGradientLinearFill'; import { translateSolidFill } from './translateSolidFill'; -const translateFill = (fill: Paint /*, width: number, height: number*/): Fill | undefined => { +const translateFill = (fill: Paint, width: number, height: number): Fill | undefined => { switch (fill.type) { case 'SOLID': return translateSolidFill(fill); - // case 'GRADIENT_LINEAR': - // return translateGradientLinearFill(fill, width, height); + case 'GRADIENT_LINEAR': + return translateGradientLinearFill(fill, width, height); } console.error('Color type ' + fill.type + ' not supported yet'); }; export const translateFills = ( - fills: readonly Paint[] | typeof figma.mixed - // width: number, - // height: number + fills: readonly Paint[] | typeof figma.mixed, + width: number, + height: number ): Fill[] => { // @TODO: think better variable name // @TODO: make it work with figma.mixed @@ -26,7 +26,7 @@ export const translateFills = ( const penpotFills = []; for (const fill of fills2) { - const penpotFill = translateFill(fill /*, width, height*/); + const penpotFill = translateFill(fill, width, height); if (penpotFill) { penpotFills.unshift(penpotFill);