MCPcopy Create free account
hub / github.com/TodePond/ScreenPond / getColourParents

Function getColourParents

source/colour.js:108–123  ·  view source on GitHub ↗
(childColour, colours)

Source from the content-addressed store, hash-verified

106
107// This could be cached if a performance boost is needed
108export const getColourParents = (childColour, colours) => {
109 const parents = [];
110 for (const colour of colours) {
111 let i = 0;
112 for (const screen of colour.screens) {
113 if (screen.colour === childColour) {
114 const inverseCorners = getMappedPositions(VIEW_CORNERS, screen.corners);
115 const parent = makeScreen(colour, inverseCorners);
116 parent.number = i;
117 parents.push(parent);
118 }
119 i++;
120 }
121 }
122 return parents;
123};

Callers 1

setWorldCornersFunction · 0.90

Calls 3

getMappedPositionsFunction · 0.90
makeScreenFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected