From 52d1f5e7d491ab13310ea7ab722d65429d655229 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Mon, 23 Mar 2020 01:01:32 +0100 Subject: exposes the alpha value as a decimal as well --- pywal/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pywal/util.py b/pywal/util.py index 7a6787e..76a364b 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -36,13 +36,17 @@ class Color: def rgba(self): """Convert a hex color to rgba.""" return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color), - int(self.alpha_num) / 100) + self.alpha_dec) @property def alpha(self): """Add URxvt alpha value to color.""" return "[%s]%s" % (self.alpha_num, self.hex_color) + @property + def alpha_dec(self): + return int(self.alpha_num) / 100 + @property def octal(self): """Export color in octal""" -- cgit v1.2.3 From 7e01b0d84cefdeb760e77f21b3c80fc5c65ce429 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Mon, 23 Mar 2020 01:03:45 +0100 Subject: add a docstring --- pywal/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pywal/util.py b/pywal/util.py index 76a364b..b83e30c 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -45,6 +45,7 @@ class Color: @property def alpha_dec(self): + """Export the alpha value as a decimal number in [0, 1].""" return int(self.alpha_num) / 100 @property -- cgit v1.2.3 From 1b07640875e3b17b48670a41c8e2a2657b756070 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Mon, 23 Mar 2020 01:04:07 +0100 Subject: docstrings all end with a dot --- pywal/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pywal/util.py b/pywal/util.py index b83e30c..5cd3135 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -50,7 +50,7 @@ class Color: @property def octal(self): - """Export color in octal""" + """Export color in octal.""" return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:]) @property @@ -79,17 +79,17 @@ class Color: return "%.3f" % (hex_to_rgb(self.hex_color)[2]/255.) def lighten(self, percent): - """Lighten color by percent""" + """Lighten color by percent.""" 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""" + """Darken color by percent.""" percent = float(re.sub(r'[\D\.]', '', str(percent))) return Color(darken_color(self.hex_color, percent / 100)) def saturate(self, percent): - """Saturate a color""" + """Saturate a color.""" percent = float(re.sub(r'[\D\.]', '', str(percent))) return Color(saturate_color(self.hex_color, percent / 100)) @@ -108,7 +108,7 @@ def read_file_json(input_file): def read_file_raw(input_file): """Read data from a file as is, don't strip - newlines or other special characters..""" + newlines or other special characters.""" with open(input_file, "r") as file: return file.readlines() -- cgit v1.2.3 From 19738dc28e1f746ff5ed5273acc2e9b5cf0d5be4 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Mon, 23 Mar 2020 01:09:05 +0100 Subject: update kitty config file to include opacity --- pywal/templates/colors-kitty.conf | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pywal/templates/colors-kitty.conf b/pywal/templates/colors-kitty.conf index 19359b0..bcf7576 100644 --- a/pywal/templates/colors-kitty.conf +++ b/pywal/templates/colors-kitty.conf @@ -1,15 +1,16 @@ -foreground {foreground} -background {background} -cursor {cursor} +foreground {foreground} +background {background} +background_opacity {background.alpha_dec} +cursor {cursor} active_tab_foreground {background} active_tab_background {foreground} inactive_tab_foreground {foreground} inactive_tab_background {background} -active_border_color {foreground} -inactive_border_color {background} -bell_border_color {color1} +active_border_color {foreground} +inactive_border_color {background} +bell_border_color {color1} color0 {color0} color8 {color8} -- cgit v1.2.3 From 0b3158490fa105e18c4da274614d63e186f22f61 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Thu, 30 Apr 2020 00:06:40 +0200 Subject: remove extra white-space --- pywal/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywal/util.py b/pywal/util.py index 5cd3135..fb04c92 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -47,7 +47,7 @@ class Color: def alpha_dec(self): """Export the alpha value as a decimal number in [0, 1].""" return int(self.alpha_num) / 100 - + @property def octal(self): """Export color in octal.""" -- cgit v1.2.3