Skip to content

Commit

Permalink
Don’t use super when it’s not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Jul 10, 2024
1 parent 819f747 commit a1745fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weasyprint/pdf/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ def set_color(self, color, stroke=False):
self._current_color = (color.space, *channels)

if color.space in ('srgb', 'hsl', 'hwb'):
super().set_color_rgb(*color.to('srgb').coordinates, stroke)
self.set_color_rgb(*color.to('srgb').coordinates, stroke)
elif color.space in ('xyz-d65', 'oklab', 'oklch'):
self.set_color_space('lab-d65', stroke)
lightness, a, b = color.to('lab').coordinates
super().set_color_special(None, stroke, lightness, a, b)
self.set_color_special(None, stroke, lightness, a, b)
elif color.space in ('xyz-d50', 'lab', 'lch'):
self.set_color_space('lab-d50', stroke)
lightness, a, b = color.to('lab').coordinates
super().set_color_special(None, stroke, lightness, a, b)
self.set_color_special(None, stroke, lightness, a, b)
else:
LOGGER.warn('Unsupported color space %s, use sRGB instead', color.space)
super().set_color_rgb(*channels, stroke)
self.set_color_rgb(*channels, stroke)
self.set_alpha(alpha, stroke)

def set_font_size(self, font, size):
Expand Down

0 comments on commit a1745fa

Please sign in to comment.