Google Sheets function that returns the hex code for the background colour of a cell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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