Skip to content

Commit

Permalink
fixup! Rename bg part to api.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhin committed Sep 27, 2023
1 parent a9803af commit 992c763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Polychrom",
"id": "1281280685402026529",
"api": "1.0.0",
"main": "dist/bg.js",
"main": "dist/api.js",
"ui": "dist/index.html",
"editorType": ["figma"],
"networkAccess": {
Expand Down
13 changes: 2 additions & 11 deletions src/api/services/payload/build-pair-selection-payload.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { buildColorsPair } from '~api/services/colors/build-colors-pair.ts';
import { blendLayersColors } from '~api/services/figma/blend/blend-layers-colors.ts';
import { getComputedNodeFill } from '~api/services/colors/get-computed-node-fill.ts';
import { createFigmaNode } from '~api/services/figma/nodes/create-figma-node.ts';
import { sortNodesByLayers } from '~api/services/figma/nodes/sort-nodes-by-layers.ts';
import { isLayerHasTransparency } from '~api/services/figma/visibility/is-layer-has-transparency.ts';
import { buildEmptyPayload } from '~api/services/payload/build-empty-payload.ts';
import { type SelectionChangeMessage } from '~types/messages.ts';
import { getFirstVisibleNodeFill } from '~utils/figma/get-first-visible-node-fill.ts';
Expand All @@ -20,15 +19,7 @@ export const buildPairSelectionPayload = (

if (!notEmpty(fg) || !notEmpty(bg)) return buildEmptyPayload();

const isFgHasTransparency = isLayerHasTransparency(fg);

let fgFill;

if (isFgHasTransparency) {
fgFill = blendLayersColors([fg]);
} else {
fgFill = getFirstVisibleNodeFill(fg.fills);
}
const fgFill = getComputedNodeFill(fg);

const bgFill = getFirstVisibleNodeFill(bg.fills);

Expand Down

0 comments on commit 992c763

Please sign in to comment.