function setAlternatingRowBackgroundColors_(range, oddColor, evenColor) {
  const backgrounds = [];
  for (let row = 1; row <= range.getNumRows(); row++) {
    const rowBackgrounds = [];
    for (let column = 1; column <= range.getNumColumns(); column++) {
      if (row % 2 === 0) {
        rowBackgrounds.push(evenColor);
      } else {
        rowBackgrounds.push(oddColor);
      }
    }
    backgrounds.push(rowBackgrounds);
  }
  range.setBackgrounds(backgrounds);
}
Sets the background colors for alternating rows within the range.
@param {Range} range The range to change the background colors of.
@param {string} oddColor The color to apply to odd rows (relative to the
    start of the range).
@param {string} evenColor The color to apply to even rows (relative to the
    start of the range).