MCPcopy Create free account
hub / github.com/adobe/leonardo / getRandomColorName

Function getRandomColorName

docs/ui/src/js/predefinedColorNames.js:68–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68function getRandomColorName() {
69 const existingColorNames = getAllColorNames();
70 const predefinedColorNames = Object.keys(colorNames);
71 let colorNameOptions = predefinedColorNames.filter((item) => !existingColorNames.includes(item));
72 return capitalizeFirstLetter(colorNameOptions[Math.floor(Math.random() * colorNameOptions.length)]);
73}
74
75export {predefinedColorNames, getClosestColorName, getRandomColorName};

Callers 2

addColorScaleFunction · 0.90
addColorsFromImageFunction · 0.90

Calls 2

getAllColorNamesFunction · 0.90
capitalizeFirstLetterFunction · 0.90

Tested by

no test coverage detected