diff options
| author | Amit Prasad <17amitprasad@gmail.com> | 2019-12-20 11:34:57 -0500 |
|---|---|---|
| committer | Amit Prasad <17amitprasad@gmail.com> | 2019-12-20 11:34:57 -0500 |
| commit | d4bd389b438df7bc4d3f302d44e23c9bbdaba8ec (patch) | |
| tree | 2df7c17653b557a86ea57dae2847a6d3edfcc33c /pywal/util.py | |
| parent | f06edfa7a2f8aba5bac24710e21389434604c8cd (diff) | |
Cleaned up code for pylint
Diffstat (limited to 'pywal/util.py')
| -rw-r--r-- | pywal/util.py | 13 |
1 files changed, 8 insertions, 5 deletions
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): |
