From 292c653220654b60e7b4997748fb1eda708851f6 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 11 Apr 2022 19:02:13 +0200 Subject: [PATCH] chore: remove logging import --- shell/common/color_util.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/common/color_util.cc b/shell/common/color_util.cc index 6f56f9214244e..4ad986cd0681f 100644 --- a/shell/common/color_util.cc +++ b/shell/common/color_util.cc @@ -17,7 +17,7 @@ namespace { -bool IsHexFormat(const std::string& str) { +bool IsHexFormatWithAlpha(const std::string& str) { // Must be either #ARGB or #AARRGGBB. bool is_hex_length = str.length() == 5 || str.length() == 9; if (str[0] != '#' || !is_hex_length) @@ -37,10 +37,12 @@ SkColor ParseCSSColor(const std::string& color_string) { // ParseCssColorString expects RGBA and we historically use ARGB // so we need to convert before passing to ParseCssColorString. std::string color_str; - if (IsHexFormat(color_string)) { + if (IsHexFormatWithAlpha(color_string)) { std::string temp = color_string; int len = color_string.length() == 5 ? 1 : 2; color_str = temp.erase(1, len) + color_string.substr(1, len); + } else { + color_str = color_string; } SkColor color;