js GetColorFromJs bugfix

Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
Change-Id: Icea80da330e9c1bc0b1f613958cac6f6171f5451
This commit is contained in:
chyyy0213
2022-02-17 10:12:27 +08:00
parent 9480234acb
commit 0cdeccbc97
@@ -174,8 +174,8 @@ static uint32_t GetColorFromJs(NativeEngine& engine, NativeObject* jsObject,
}
WLOGFI("origin color: %{public}s", colorStr.c_str());
std::string color = colorStr.substr(1);
if (colorStr.length() == RGB_LENGTH) {
colorStr = "FF" + colorStr; // ARGB
if (color.length() == RGB_LENGTH) {
color = "FF" + color; // ARGB
}
std::stringstream ss;
uint32_t hexColor;