MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / mapColors

Function mapColors

packages/backend/src/nearest-color/nearestColor.ts:71–73  ·  view source on GitHub ↗

* Given either an array or object of colors, returns an array of * ColorSpec objects (with RGB values). * * @private * @param {Array. |Object} colors An array of hex-based color strings, or * an object mapping color *names* to hex values. * @return {Array.

(colors: Array<string>)

Source from the content-addressed store, hash-verified

69 * representing the same colors passed in.
70 */
71function mapColors(colors: Array<string>): Array<ColorSpec> {
72 return colors.map((color) => createColorSpec(color));
73}
74
75/**
76 * Provides a matcher to find the nearest color based on the provided list of

Callers 1

nearestColorFromFunction · 0.85

Calls 1

createColorSpecFunction · 0.85

Tested by

no test coverage detected