code: function checkPaletteValid(name, map) {
      var missingColors = VALID_HUE_VALUES.filter(function(field) {
        return !map[field];
      });
      if (missingColors.length) {
        throw new Error("Missing colors %1 in palette %2!"
                        .replace('%1', missingColors.join(', '))
                        .replace('%2', name));
      }
  
      return map;
    }
docs: Make sure that palette has all required hues