MCPcopy Create free account
hub / github.com/davidmerfield/randomColor / getRealHueRange

Function getRealHueRange

randomColor.js:587–608  ·  view source on GitHub ↗
(colorHue)

Source from the content-addressed store, hash-verified

585
586 // get The range of given hue when options.count!=0
587 function getRealHueRange(colorHue) {
588 if (!isNaN(colorHue)) {
589 var number = parseInt(colorHue);
590
591 if (number < 360 && number > 0) {
592 return getColorInfo(colorHue).hueRange;
593 }
594 } else if (typeof colorHue === "string") {
595 if (colorDictionary[colorHue]) {
596 var color = colorDictionary[colorHue];
597
598 if (color.hueRange) {
599 return color.hueRange;
600 }
601 } else if (colorHue.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)) {
602 var hue = HexToHSB(colorHue)[0];
603 return getColorInfo(hue).hueRange;
604 }
605 }
606
607 return [0, 360];
608 }
609 return randomColor;
610});

Callers 1

pickHueFunction · 0.85

Calls 2

getColorInfoFunction · 0.85
HexToHSBFunction · 0.85

Tested by

no test coverage detected