function withAlpha(color) {
  if (color.length === 4) {
    return color;
  }
  const output = color.slice();
  output[3] = 1;
  return output;
}
@param {Color} color A color that may or may not have an alpha channel.
@return {Color} The input color with an alpha channel.  If the input color has
an alpha channel, the input color will be returned unchanged.  Otherwise, a new
array will be returned with the input color and an alpha channel of 1.