@@ -53,6 +53,12 @@ def __init__(self):
53
53
self .logo = m .ImageMobject (settings .logo )
54
54
self .logo .width = 3
55
55
56
+ self .fill_opacity = 0.25
57
+ self .ref_fill_opacity = 0.25
58
+ if settings .transparent_bg :
59
+ self .fill_opacity = 0.5
60
+ self .ref_fill_opacity = 1.0
61
+
56
62
def init_repo (self ):
57
63
try :
58
64
self .repo = Repo (search_parent_directories = True )
@@ -224,14 +230,14 @@ def get_centers(self):
224
230
225
231
def draw_commit (self , commit , i , prevCircle , shift = numpy .array ([0.0 , 0.0 , 0.0 ])):
226
232
if commit == "dark" :
227
- commitFill = m .WHITE if settings .light_mode else m .BLACK
233
+ commit_fill = m .WHITE if settings .light_mode else m .BLACK
228
234
elif len (commit .parents ) <= 1 :
229
- commitFill = m .RED
235
+ commit_fill = m .RED
230
236
else :
231
- commitFill = m .GRAY
232
-
237
+ commit_fill = m .GRAY
238
+
233
239
circle = m .Circle (
234
- stroke_color = commitFill , fill_color = commitFill , fill_opacity = 0.25
240
+ stroke_color = commit_fill , fill_color = commit_fill , fill_opacity = self . fill_opacity
235
241
)
236
242
circle .height = 1
237
243
@@ -363,7 +369,7 @@ def build_commit_id_and_message(self, commit, i):
363
369
364
370
def draw_head (self , commit , i , commitId ):
365
371
if commit .hexsha == self .repo .head .commit .hexsha :
366
- headbox = m .Rectangle (color = m .BLUE , fill_color = m .BLUE , fill_opacity = 0.25 )
372
+ headbox = m .Rectangle (color = m .BLUE , fill_color = m .BLUE , fill_opacity = self . ref_fill_opacity )
367
373
headbox .width = 1
368
374
headbox .height = 0.4
369
375
if settings .highlight_commit_messages :
@@ -423,7 +429,7 @@ def draw_branch(self, commit, i, make_branches_remote=False):
423
429
branchRec = m .Rectangle (
424
430
color = m .GREEN ,
425
431
fill_color = m .GREEN ,
426
- fill_opacity = 0.25 ,
432
+ fill_opacity = self . ref_fill_opacity ,
427
433
height = 0.4 ,
428
434
width = branchText .width + 0.25 ,
429
435
)
@@ -468,7 +474,7 @@ def draw_tag(self, commit, i):
468
474
tagRec = m .Rectangle (
469
475
color = m .YELLOW ,
470
476
fill_color = m .YELLOW ,
471
- fill_opacity = 0.25 ,
477
+ fill_opacity = self . ref_fill_opacity ,
472
478
height = 0.4 ,
473
479
width = tagText .width + 0.25 ,
474
480
)
@@ -954,7 +960,7 @@ def setup_and_draw_parent(
954
960
draw_arrow = True ,
955
961
color = m .RED ,
956
962
):
957
- circle = m .Circle (stroke_color = color , fill_color = color , fill_opacity = 0.25 )
963
+ circle = m .Circle (stroke_color = color , fill_color = color , fill_opacity = self . ref_fill_opacity )
958
964
circle .height = 1
959
965
circle .next_to (
960
966
self .drawnCommits [child .hexsha ],
@@ -1033,7 +1039,7 @@ def draw_ref(self, commit, top, i=0, text="HEAD", color=m.BLUE):
1033
1039
refbox = m .Rectangle (
1034
1040
color = color ,
1035
1041
fill_color = color ,
1036
- fill_opacity = 0.25 ,
1042
+ fill_opacity = self . ref_fill_opacity ,
1037
1043
height = 0.4 ,
1038
1044
width = refText .width + 0.25 ,
1039
1045
)
0 commit comments