diff --git a/src/api/services/colors/handle-opaque-layer.ts b/src/api/services/colors/handle-opaque-background.ts similarity index 94% rename from src/api/services/colors/handle-opaque-layer.ts rename to src/api/services/colors/handle-opaque-background.ts index 17bd6c8..4ebe6af 100644 --- a/src/api/services/colors/handle-opaque-layer.ts +++ b/src/api/services/colors/handle-opaque-background.ts @@ -5,7 +5,7 @@ import { type FigmaNode } from '~types/figma.ts'; import { getFirstVisibleNodeFill } from '~utils/figma/get-first-visible-node-fill.ts'; import { notEmpty } from '~utils/not-empty.ts'; -export const handleOpaqueLayer = ( +export const handleOpaqueBackground = ( selectedNode: FigmaNode, firstIntersectingNode: FigmaNode ): ColorPair | null => { diff --git a/src/api/services/colors/handle-transparent-layer.ts b/src/api/services/colors/handle-transparent-background.ts similarity index 85% rename from src/api/services/colors/handle-transparent-layer.ts rename to src/api/services/colors/handle-transparent-background.ts index 7ab6985..81d3858 100644 --- a/src/api/services/colors/handle-transparent-layer.ts +++ b/src/api/services/colors/handle-transparent-background.ts @@ -5,7 +5,7 @@ import { type ColorPair } from '~api/types.ts'; import { type FigmaNode } from '~types/figma.ts'; import { notEmpty } from '~utils/not-empty.ts'; -export const handleTransparentLayer = ( +export const handleTransparentBackground = ( selectedNode: FigmaNode, intersectingNodes: FigmaNode[] ): ColorPair | null => { @@ -14,7 +14,7 @@ export const handleTransparentLayer = ( const fgFill = getComputedNodeFill(selectedNode); if (notEmpty(fgFill) && notEmpty(blendedBgColor)) - buildColorsPair(selectedNode.id, fgFill, blendedBgColor); + return buildColorsPair(selectedNode.id, fgFill, blendedBgColor); return null; }; diff --git a/src/api/services/selection/process-node-for-selection.ts b/src/api/services/selection/process-node-for-selection.ts index 1ccc51e..2188d2c 100644 --- a/src/api/services/selection/process-node-for-selection.ts +++ b/src/api/services/selection/process-node-for-selection.ts @@ -1,5 +1,5 @@ -import { handleOpaqueLayer } from '~api/services/colors/handle-opaque-layer.ts'; -import { handleTransparentLayer } from '~api/services/colors/handle-transparent-layer.ts'; +import { handleOpaqueBackground } from '~api/services/colors/handle-opaque-background.ts'; +import { handleTransparentBackground } from '~api/services/colors/handle-transparent-background.ts'; import { getIntersectingNodesWithPage } from '~api/services/figma/intersections/get-intersecting-nodes-with-page.ts'; import { createFigmaNode } from '~api/services/figma/nodes/create-figma-node.ts'; import { isLayerHasTransparency } from '~api/services/figma/visibility/is-layer-has-transparency.ts'; @@ -17,8 +17,8 @@ export const processNodeForSelection = (node: SceneNode): ColorPair | null => { if (!notEmpty(firstIntersectingNode)) return null; if (isLayerHasTransparency(firstIntersectingNode)) { - return handleTransparentLayer(figmaNode, intersectingNodes); + return handleTransparentBackground(figmaNode, intersectingNodes); } else { - return handleOpaqueLayer(figmaNode, firstIntersectingNode); + return handleOpaqueBackground(figmaNode, firstIntersectingNode); } };