AppsScriptPulse

How to format cells through code in Google Sheets

If you had used the GUI to manage your custom formulas used for conditional formatting, then to see and manage that logic, you would have to find and select the correct cell, or select the entire spreadsheet, and then right click and select “Conditional Formatting”, or go to the menu and select “Format -> Conditional Formatting”, to actually see and edit that logic. Which can be quite inconvenient at times.

Set conditional formatting rules through your script, which would allow you to keep everything configured in a single script.

Source: How to format cells through code in Google Sheets