function getNumComponentsForFormat(format) {
  var info = formatInfo[format];

  if (!info) {
    throw "unknown format: " + format;
  }

  return info.numColorComponents;
}
Gets the number of components for a given image format.
@param {number} format the format.
@return {number} the number of components for the format.
@memberOf module:twgl/textures