(childColour, colours)
| 106 | |
| 107 | // This could be cached if a performance boost is needed |
| 108 | export 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 | }; |
no test coverage detected