MCPcopy Index your code
hub / github.com/davidmerfield/randomColor / getColorInfo

Function getColorInfo

randomColor.js:292–312  ·  view source on GitHub ↗
(hue)

Source from the content-addressed store, hash-verified

290 }
291
292 function getColorInfo(hue) {
293 // Maps red colors to make picking hue easier
294 if (hue >= 334 && hue <= 360) {
295 hue -= 360;
296 }
297 if (hue < 0) {
298 hue *= -1;
299 }
300
301 for (var colorName in colorDictionary) {
302 var color = colorDictionary[colorName];
303 if (
304 color.hueRange &&
305 hue >= color.hueRange[0] &&
306 hue <= color.hueRange[1]
307 ) {
308 return colorDictionary[colorName];
309 }
310 }
311 return "Color not found";
312 }
313
314 function randomWithin(range) {
315 if (seed === null) {

Callers 3

getMinimumBrightnessFunction · 0.85
getSaturationRangeFunction · 0.85
getRealHueRangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…