Gradients are of "image" date type and they do not work for CSS properties of "color" type, e.g. background-color and color. The Spreadsheet Range object's background API method sets the background-color of the cell, so a gradient cannot be used for the mentioned reasons.
With regard to adding a class to a range, there is no API method dedicated to that. If you want to see such functionality added to the Spreadsheet, consider logging this as a feature request in our Feedback Portal.
Progress is here for your business, like always. Read more
about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.