Playing around with GAS color

Using a color table

In Looking up color table, we covered how to use a color table to reference to make palettes using the functions described in Playing around with colors in VBA. But that was in Excel – now here’s the Google Apps Script Version.

The workbook

We’ll use the same workbook as in Google Script Color Ramp. The color table is one of the tabs below.

Copy of heatMap

Code for test Example

This code produces the example above.  It has many thousands of lines,  a bit too many for GAS to be effective. I am using caching  for both data and cell properties, and using Data manipulation Classes in Google Apps Script means that the GAS code is almost identical to the VBA code. It took about 10 minutes to convert this – but a lot longer to run it.

This is all that’s needed. The color ramp and caching utilities are provided in the mcpher script library.