Reset the background color of a Cell in pysheet

372 views Asked by At

Trying to reset the color of a linked cell.

Looking at a cell without color, the color attribute is (None, None, None, None)

So I tried:

cell.color = (None, None, None, None)

and

cell.color = None

Both raise

TypeError: '<' not supported between instances of 'NoneType' and 'int'

Is reseting the color supported by pysheets?

2

There are 2 answers

1
bényam1n On BEST ANSWER

To reset the color you can do :

cell.color = ()
2
Dr. Mantis Tobbogan On

According to the Google Sheets API you need to pass a RGBA value, which means that you need to pass in values that are acceptable for the RGBA spectrum (0-255).

Try cell.color = (0,0,0,0), the fourth digit in the sequence specifies the alpha channel to be transparent.

Hopefully that helps.