From 056eb28d1ccbec987e1959d1e4e22030a089721f Mon Sep 17 00:00:00 2001 From: Alexandre Lavigne Date: Tue, 24 Oct 2023 14:13:40 +0200 Subject: [PATCH] New usage of hex value for tab colors Signed-off-by: Alexandre Lavigne --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 209817314..d22e0252d 100644 --- a/README.md +++ b/README.md @@ -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