ZahirJS commited on
Commit
0412567
·
verified ·
1 Parent(s): 335f9c7

Update graph_generator_utils.py

Browse files
Files changed (1) hide show
  1. graph_generator_utils.py +4 -0
graph_generator_utils.py CHANGED
@@ -18,6 +18,10 @@ def add_nodes_and_edges(dot: graphviz.Digraph, parent_id: str, nodes_list: list,
18
  lightening_factor = 0.12
19
 
20
  # Convert base_color hex to RGB for interpolation
 
 
 
 
21
  base_r = int(base_color[1:3], 16)
22
  base_g = int(base_color[3:5], 16)
23
  base_b = int(base_color[5:7], 16)
 
18
  lightening_factor = 0.12
19
 
20
  # Convert base_color hex to RGB for interpolation
21
+ # Ensure base_color is a valid hex string before converting
22
+ if not isinstance(base_color, str) or not base_color.startswith('#') or len(base_color) != 7:
23
+ base_color = '#19191a' # Fallback to default dark if invalid
24
+
25
  base_r = int(base_color[1:3], 16)
26
  base_g = int(base_color[3:5], 16)
27
  base_b = int(base_color[5:7], 16)