I was having trouble getting my script to highlight a range and after debugging for a bit, realized that there seems to be something wrong with the call of type
range.setBackground("name of color");
So, I went to GAS reference website and used the example from their page: https://developers.google.com/apps-script/reference/spreadsheet/range#setFontColor(String)
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var cell = sheet.getRange("B2");
cell.setFontColor("red");
This code results in !ERROR. If I force a return before setFontColor() call, all is fine. (and by fine I mean it returns from the function without an error, but of course, without having set the color).
What am I doing wrong?