Google Spreadsheet has in the toolbar under the border button also a button to change the color and change the border style.
How can these be accessed within a Google Apps Script?
The setBorderColor
function which is described for documents seems unavailable for spreadsheets.
The reported issue has been fixed, as of 12 Jan 2016. Range now has these methods:
Examples are provided in the documentation; here's how to set a dashed red border*:
*Corrected, as per comment: the documentation is wrong, it should be SpreadsheetApp.BorderStyle.DASHED/DOTTED/SOLID, not Range. – gotofritz
Currently the setBorder() properties do not allow us to provide color and style. There is an open issue you can follow here.
You can do a little trick. Copy the formatting in a coloured border cell to where ever you want.