Skip to content

Commit

Permalink
New usage of hex value for tab colors
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Lavigne <[email protected]>
  • Loading branch information
lavigne958 committed Oct 24, 2023
1 parent 47d58e2 commit 056eb28
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ file.sheet1.update(range_name="I7", values=[["54"]])

the argument `values` must be a list of list !

### New tab color usage

GSpread now uses hexadecimal value to color a tab.

You can use the utility function `gspread.utils.convert_colors_to_hex_value` to convert dict values to a single hexadecimal values.

The method ``gspread.Worksheet.update_tab_color()` accepts both dict and string values.

You can update you code as follow:

```python
tab_color = {"red": 1, "green": 0.1345, "blue": 1}
file.sheet1.update_tab_color(convert_colors_to_hex_value(**tab_color))
```

## Installation

```sh
Expand Down

0 comments on commit 056eb28

Please sign in to comment.