@@ -278,7 +278,7 @@ cdef list kv_color_to_int_color(color):
278
278
c = [int (255 * x) for x in color]
279
279
return c if len (c) == 4 else c + [255 ]
280
280
281
- cdef parse_color(c, current_color = None ):
281
+ cdef parse_color(c, current_color = None ):
282
282
cdef int r, g, b, a
283
283
if c is None or c == ' none' :
284
284
return None
@@ -410,9 +410,9 @@ class Gradient(object):
410
410
for e in element.getiterator():
411
411
if e.tag.endswith(' stop' ):
412
412
style = parse_style(e.get(' style' , ' ' ))
413
- color = parse_color(e.get(' stop-color' ), current_color = svg.current_color)
413
+ color = parse_color(e.get(' stop-color' ), svg.current_color)
414
414
if ' stop-color' in style:
415
- color = parse_color(style[' stop-color' ], current_color = svg.current_color)
415
+ color = parse_color(style[' stop-color' ], svg.current_color)
416
416
color[3 ] = int (float (e.get(' stop-opacity' , ' 1' )) * 255 )
417
417
if ' stop-opacity' in style:
418
418
color[3 ] = int (float (style[' stop-opacity' ]) * 255 )
@@ -646,8 +646,8 @@ cdef class Svg(RenderContext):
646
646
self .parse_element(e)
647
647
648
648
cdef parse_element(self , e):
649
- self .fill = parse_color(e.get(' fill' ), current_color = self .current_color)
650
- self .stroke = parse_color(e.get(' stroke' ), current_color = self .current_color)
649
+ self .fill = parse_color(e.get(' fill' ), self .current_color)
650
+ self .stroke = parse_color(e.get(' stroke' ), self .current_color)
651
651
oldopacity = self .opacity
652
652
self .opacity *= float (e.get(' opacity' , 1 ))
653
653
fill_opacity = float (e.get(' fill-opacity' , 1 ))
@@ -661,11 +661,11 @@ cdef class Svg(RenderContext):
661
661
if style:
662
662
sdict = parse_style(style)
663
663
if ' fill' in sdict:
664
- self .fill = parse_color(sdict[' fill' ], current_color = self .current_color)
664
+ self .fill = parse_color(sdict[' fill' ], self .current_color)
665
665
if ' fill-opacity' in sdict:
666
666
fill_opacity *= float (sdict[' fill-opacity' ])
667
667
if ' stroke' in sdict:
668
- self .stroke = parse_color(sdict[' stroke' ], current_color = self .current_color)
668
+ self .stroke = parse_color(sdict[' stroke' ], self .current_color)
669
669
if ' stroke-opacity' in sdict:
670
670
stroke_opacity *= float (sdict[' stroke-opacity' ])
671
671
0 commit comments