This is a sample script for setting alternate background colors for rows in Google Spreadsheet using Google Apps Script.
It has already been known when the conditional formatting rule and custom function are used, this can be simply achieved. In this report, I would like to introduce the method for using Google Apps Script.
Source: Setting Alternate Background Colors for Rows in Google Spreadsheet using Google Apps Script
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.