Skip to content

Instantly share code, notes, and snippets.

@zackbatist
Created February 17, 2019 18:59
Embed
What would you like to do?
Google Sheets function that returns the hex code for the background colour of a cell
/**
* getHex.gs
* =getHex(cell("address",A1)) returns hex code for background colour of cell A1
* taken from https://stackoverflow.com/questions/28962526/google-spreadsheets-sort-filter-by-background-fill
*/
function getHex(input) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var cell = ss.getRange(input);
var result = cell.getBackground();
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment