图标升级

This commit is contained in:
2026-05-16 00:44:37 +08:00
parent 837996c436
commit d80e8dd05d
2113 changed files with 14850 additions and 244328 deletions

22
test_svg.py Normal file
View File

@@ -0,0 +1,22 @@
from PyQt6.QtWidgets import QApplication, QLabel
from PyQt6.QtGui import QPixmap
import sys
import base64
app = QApplication(sys.argv)
def get_colored_svg_uri(path: str, color: str) -> str:
with open(path, 'r', encoding='utf-8') as f:
svg_content = f.read()
svg_content = svg_content.replace('currentColor', color)
b64 = base64.b64encode(svg_content.encode('utf-8')).decode('utf-8')
return f"data:image/svg+xml;base64,{b64}"
path = "third_party/Bootstrap/bootstrap-icons-1.13.1/reception-4.svg"
uri = get_colored_svg_uri(path, "#a0d8a0")
label = QLabel()
label.setText(f"<img src='{uri}'> Hello")
label.show()
sys.exit(app.exec())