(red, green, blue)
| 211 | }; |
| 212 | |
| 213 | const getSplash = (red, green, blue) => { |
| 214 | const closestRed = getClosest(red, reds).toString(); |
| 215 | const closestGreen = getClosest(green, greens).toString(); |
| 216 | const closestBlue = getClosest(blue, blues).toString(); |
| 217 | const string = closestRed + closestGreen + closestBlue; |
| 218 | const splash = parseInt(string); |
| 219 | return splash; |
| 220 | }; |
| 221 | |
| 222 | const getClosest = (number, array) => { |
| 223 | let highscore = Infinity; |
no test coverage detected