// 计算出经验灰度值,然后反色作为文字颜色const getTextColorFromHex = (bgColor) => {if (/^#([0-9a-f-A-F]{3}|[0-9a-f-A-F]{6})$/.test(bgColor))return bgColor.replace(/^#/, "").replace(/^\w+$/, c =>c.length == 3? c.split("").map(c => c.repeat(2)).join(""): c).match(/\w{2}/g).map(hexV => parseInt(hexV, 16)).reduce((t, v, i) => t + [0.299, 0.587, 0.114][i] * v, 0) /255 >0.5? "#000": "#fff"elsereturn '#fff'}
openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout localhost.key -out localhost.pem -subj "/C=US/CN=Example-Root-CA"openssl x509 -outform pem -in localhost.pem -out localhost.crt
const roundRect = (ctx, x, y, w, h, r) => {var min_size = Math.min(w, h);if (r > min_size / 2) r = min_size / 2;ctx.moveTo(x + r, y);ctx.arcTo(x + w, y, x + w, y + h, r);ctx.arcTo(x + w, y + h, x, y + h, r);ctx.arcTo(x, y + h, x, y, r);ctx.arcTo(x, y, x + w, y, r);}const roundImage = (ctx, image, x, y, w, h, r) => {ctx.save()ctx.beginPath();roundRect(ctx, x, y, w, h, r);ctx.clip()ctx.closePath();ctx.drawImage(image, 0, 0, image.width, image.height, x, y, w, h);ctx.restore()}const drawText = (ctx, text, x, y, maxWidth, lineHeight) => {let arrText = text.split('');let line = '';for (let n = 0; n < arrText.length; n++) {let testLine = line + arrText[n];let metrics = ctx.measureText(testLine);let testWidth = metrics.width;if (testWidth > maxWidth && n > 0) {ctx.fillText(line, x, y);line = arrText[n];y += lineHeight;} else {line = testLine;}}ctx.fillText(line, x, y);return y + lineHeight}
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin::D:\android_sdk\emulator\emulator.exe -netdelay none -netspeed full -avd fake_Pixel_3_XL_29
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin::"D:\Program Files\scrcpy-win64-v1.16\scrcpy.exe" -s a9e8d32c
🔝