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
This commit is contained in:
patrick96 2018-05-06 19:13:27 +02:00 committed by Patrick Ziegler
parent 758dbb85ed
commit 3408db3475
1 changed files with 0 additions and 4 deletions

View File

@ -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);