From d4bd389b438df7bc4d3f302d44e23c9bbdaba8ec Mon Sep 17 00:00:00 2001 From: Amit Prasad <17amitprasad@gmail.com> Date: Fri, 20 Dec 2019 11:34:57 -0500 Subject: Cleaned up code for pylint --- pywal/util.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'pywal/util.py') diff --git a/pywal/util.py b/pywal/util.py index 74fe1f0..cd6628a 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -5,11 +5,11 @@ import colorsys import json import logging import os +import platform +import re import shutil import subprocess import sys -import platform -import re class Color: @@ -60,15 +60,18 @@ class Color: def lighten(self, percent): """Lighten color by percent""" - return Color(lighten_color(self.hex_color, float(re.sub(r'[\D\.]', '', percent)) / 100)) + percent = float(re.sub(r'[\D\.]', '', str(percent))) + return Color(lighten_color(self.hex_color, percent / 100)) def darken(self, percent): """Darken color by percent""" - return Color(darken_color(self.hex_color, float(re.sub(r'[\D\.]', '', percent)) / 100)) + percent = float(re.sub(r'[\D\.]', '', str(percent))) + return Color(darken_color(self.hex_color, percent / 100)) def saturate(self, percent): """Saturate a color""" - return Color(saturate_color(self.hex_color, float(re.sub(r'[\D\.]', '', percent)) / 100)) + percent = float(re.sub(r'[\D\.]', '', str(percent))) + return Color(saturate_color(self.hex_color, percent / 100)) def read_file(input_file): -- cgit v1.2.3