mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 05:33:02 -05:00
custom gradient
This commit is contained in:
parent
f1e6f76c4f
commit
b338027e74
1 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue