mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -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 { Fill } from '@ui/lib/types/utils/fill';
|
||||||
|
|
||||||
// import { translateGradientLinearFill } from './translateGradientLinearFill';
|
import { translateGradientLinearFill } from './translateGradientLinearFill';
|
||||||
import { translateSolidFill } from './translateSolidFill';
|
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) {
|
switch (fill.type) {
|
||||||
case 'SOLID':
|
case 'SOLID':
|
||||||
return translateSolidFill(fill);
|
return translateSolidFill(fill);
|
||||||
// case 'GRADIENT_LINEAR':
|
case 'GRADIENT_LINEAR':
|
||||||
// return translateGradientLinearFill(fill, width, height);
|
return translateGradientLinearFill(fill, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error('Color type ' + fill.type + ' not supported yet');
|
console.error('Color type ' + fill.type + ' not supported yet');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const translateFills = (
|
export const translateFills = (
|
||||||
fills: readonly Paint[] | typeof figma.mixed
|
fills: readonly Paint[] | typeof figma.mixed,
|
||||||
// width: number,
|
width: number,
|
||||||
// height: number
|
height: number
|
||||||
): Fill[] => {
|
): Fill[] => {
|
||||||
// @TODO: think better variable name
|
// @TODO: think better variable name
|
||||||
// @TODO: make it work with figma.mixed
|
// @TODO: make it work with figma.mixed
|
||||||
|
@ -26,7 +26,7 @@ export const translateFills = (
|
||||||
const penpotFills = [];
|
const penpotFills = [];
|
||||||
|
|
||||||
for (const fill of fills2) {
|
for (const fill of fills2) {
|
||||||
const penpotFill = translateFill(fill /*, width, height*/);
|
const penpotFill = translateFill(fill, width, height);
|
||||||
|
|
||||||
if (penpotFill) {
|
if (penpotFill) {
|
||||||
penpotFills.unshift(penpotFill);
|
penpotFills.unshift(penpotFill);
|
||||||
|
|
Loading…
Reference in a new issue