From 3408db3475407cd762d22cc6d7d55ffee135f4dd Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sun, 6 May 2018 19:13:27 +0200 Subject: [PATCH] fix(builder): Don't truncate colors with same channels The builder would convert bg and fg colors like #00000000 to #000 which would make it loose its alpha channel. Fixes #1183 --- src/components/builder.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/builder.cpp b/src/components/builder.cpp index 33d972d1..6804872a 100644 --- a/src/components/builder.cpp +++ b/src/components/builder.cpp @@ -356,8 +356,6 @@ void builder::background(string color) { string bg{background_hex()}; color = "#" + color.substr(color.length() - 2); color += bg.substr(bg.length() - (bg.length() < 6 ? 3 : 6)); - } else if (color.length() >= 7 && color == "#" + string(color.length() - 1, color[1])) { - color = color.substr(0, 4); } color = color_util::simplify_hex(color); @@ -383,8 +381,6 @@ void builder::color(string color) { color = "#" + color.substr(color.length() - 2); color += fg.substr(fg.length() - (fg.length() < 6 ? 3 : 6)); } - } else if (color.length() >= 7 && color == "#" + string(color.length() - 1, color[1])) { - color = color.substr(0, 4); } color = color_util::simplify_hex(color);