@@ -53,6 +53,12 @@ def __init__(self):
5353 self .logo = m .ImageMobject (settings .logo )
5454 self .logo .width = 3
5555
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+
5662 def init_repo (self ):
5763 try :
5864 self .repo = Repo (search_parent_directories = True )
@@ -224,14 +230,14 @@ def get_centers(self):
224230
225231 def draw_commit (self , commit , i , prevCircle , shift = numpy .array ([0.0 , 0.0 , 0.0 ])):
226232 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
228234 elif len (commit .parents ) <= 1 :
229- commitFill = m .RED
235+ commit_fill = m .RED
230236 else :
231- commitFill = m .GRAY
232-
237+ commit_fill = m .GRAY
238+
233239 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
235241 )
236242 circle .height = 1
237243
@@ -363,7 +369,7 @@ def build_commit_id_and_message(self, commit, i):
363369
364370 def draw_head (self , commit , i , commitId ):
365371 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 )
367373 headbox .width = 1
368374 headbox .height = 0.4
369375 if settings .highlight_commit_messages :
@@ -423,7 +429,7 @@ def draw_branch(self, commit, i, make_branches_remote=False):
423429 branchRec = m .Rectangle (
424430 color = m .GREEN ,
425431 fill_color = m .GREEN ,
426- fill_opacity = 0.25 ,
432+ fill_opacity = self . ref_fill_opacity ,
427433 height = 0.4 ,
428434 width = branchText .width + 0.25 ,
429435 )
@@ -468,7 +474,7 @@ def draw_tag(self, commit, i):
468474 tagRec = m .Rectangle (
469475 color = m .YELLOW ,
470476 fill_color = m .YELLOW ,
471- fill_opacity = 0.25 ,
477+ fill_opacity = self . ref_fill_opacity ,
472478 height = 0.4 ,
473479 width = tagText .width + 0.25 ,
474480 )
@@ -954,7 +960,7 @@ def setup_and_draw_parent(
954960 draw_arrow = True ,
955961 color = m .RED ,
956962 ):
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 )
958964 circle .height = 1
959965 circle .next_to (
960966 self .drawnCommits [child .hexsha ],
@@ -1033,7 +1039,7 @@ def draw_ref(self, commit, top, i=0, text="HEAD", color=m.BLUE):
10331039 refbox = m .Rectangle (
10341040 color = color ,
10351041 fill_color = color ,
1036- fill_opacity = 0.25 ,
1042+ fill_opacity = self . ref_fill_opacity ,
10371043 height = 0.4 ,
10381044 width = refText .width + 0.25 ,
10391045 )
0 commit comments