Building off of this question about setting a color, I wonder how to reset/clear the color of a Google Sheet's tab.
For reference, here is how to set a color
sheet = open_worksheet() # does all the auth/credential work
new_tab = sheet.worksheet('DemoTab')
body = {
"requests": [
{
"updateSheetProperties": {
"properties": {
"sheetId": new_tab.id,
"tabColor": {
"red": 1.0,
"green": 0.3,
"blue": 0.4
}
},
"fields": "tabColor"
}
}
]
}
try:
res = sheet.batch_update(body)
pprint(res)
except gspread.exceptions.APIError as gea:
pprint(gea.args[0], width=100)
All the documentation states that "tabColor" should be a Color object (as shown above with a dict of red, green, and blue). There is also an optional alpha.
There is also a "tabColorStyle" parameter, but it too is looking for a color.
I have tried setting "tabColor" to an empty dict, {}
, RGB to 0 each, and RGB to -1 each. All end up just turning the color black.
There is no mention of a .clear
option.
So how do I remove the color once it has been set?
Here is a link to the Google Sheet API and Sheet properties where I've been looking up how the request should look.