src/debug.js
/**
 * Selects a color for a debug namespace
 * @param {String} namespace The namespace string for the for the debug instance to be colored
 * @param {String} colors color pallette to choose from
 * @return {Number|String} An ANSI color code for the given namespace
 * @api private
 */
Selects a color for a debug namespace
@param {String} namespace The namespace string for the for the debug instance to be colored
@param {String} colors color pallette to choose from
@return {Number|String} An ANSI color code for the given namespace
@api private
Selects a color for a debug namespace @param { String } namespace The namespace string for the for the debug instance to be colored @param { String } colors color pallette to choose from @return { Number|String } An ANSI color code for the given namespace @api private
function selectColor(namespace, colors) {
  let hash = 0;
  for (let i = 0; i < namespace.length; i++) {
    hash = (hash << 5) - hash + namespace.charCodeAt(i);
    hash |= 0; 
  }
  return colors[Math.abs(hash) % colors.length];
}
function selectColor ( namespace , colors ) { let hash = 0 ; for ( let i = 0 ; i < namespace . length ; i ++ ) { hash = ( hash << 5 ) - hash + namespace . charCodeAt ( i ) ; hash |= 0 ; } return colors [ Math . abs ( hash ) % colors . length ] ; }
Selects a color for a debug namespace
 @param {String} namespace The namespace string for the for the debug instance to be colored
 @param {String} colors color pallette to choose from
 @return {Number|String} An ANSI color code for the given namespace
 @api private
Selects a color for a debug namespace @param { String } namespace The namespace string for the for the debug instance to be colored @param { String } colors color pallette to choose from @return { Number|String } An ANSI color code for the given namespace @api private
// Convert to 32bit integer