import sys from PySide6.QtGui import QColor, QPalette from PySide6.QtWidgets import QApplication from .ui.main_window import MainWindow def light_palette() -> QPalette: """The same light look on every system. All status colours in the tool are chosen for a light background; with macOS dark mode they were unreadable.""" p = QPalette() roles = { QPalette.ColorRole.Window: "#f4f5f7", QPalette.ColorRole.WindowText: "#1d1d1f", QPalette.ColorRole.Base: "#ffffff", QPalette.ColorRole.AlternateBase: "#f0f2f5", QPalette.ColorRole.Text: "#1d1d1f", QPalette.ColorRole.Button: "#e9ebef", QPalette.ColorRole.ButtonText: "#1d1d1f", QPalette.ColorRole.ToolTipBase: "#ffffe8", QPalette.ColorRole.ToolTipText: "#1d1d1f", QPalette.ColorRole.PlaceholderText: "#8a8a8a", QPalette.ColorRole.Highlight: "#2e6da4", QPalette.ColorRole.HighlightedText: "#ffffff", QPalette.ColorRole.Link: "#1f5fa8", QPalette.ColorRole.BrightText: "#ffffff", } for role, colour in roles.items(): p.setColor(role, QColor(colour)) for role in (QPalette.ColorRole.WindowText, QPalette.ColorRole.Text, QPalette.ColorRole.ButtonText): p.setColor(QPalette.ColorGroup.Disabled, role, QColor("#9a9a9a")) return p def main() -> int: app = QApplication(sys.argv) app.setStyle("Fusion") app.setPalette(light_palette()) win = MainWindow() win.show() return app.exec() if __name__ == "__main__": sys.exit(main())