Commit 31800c2d authored by 郭志伟's avatar 郭志伟

fix: rgb格式过滤

parent 4dfe0bf3
......@@ -81,7 +81,8 @@ export function setAppTitleColor(bgcolor = "#fff") {
if (!isApp && !EASY_ENV_IS_BROWSER) return;
let jsBridge = new Bridge();
const isGradient = Array.isArray(bgcolor);
const rgbColor = hexToRgb(isGradient ? bgcolor[0] : bgcolor);
let rgbColor = hexToRgb(isGradient ? bgcolor[0] : bgcolor);
if (rgbColor.toLocaleLowerCase().indexOf("rgb") === -1) rgbColor = hexToRgb(rgbColor);
const isDarkContent = 0.213 * rgbColor[0] + 0.715 * rgbColor[1] + 0.072 * rgbColor[2] <= 255 / 2;
const colors = isGradient
? [bgcolor[0].substr(1), bgcolor[1].substr(1)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment