I would need to get in python the font color and background color used by the FC theme...
how can I get i.e. the font color and background of the FC main window?
or better how can I get the theme font and background color attributes?
[solved] how can I get the font color and background of the FC used theme
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[solved] how can I get the font color and background of the FC used theme
Last edited by easyw-fc on Wed Feb 08, 2023 3:44 pm, edited 1 time in total.
Re: how can I get the font color and background of the FC used theme
Code: Select all
from PySide2 import QtGui
QtGui.QGuiApplication.palette().text().color()
QtGui.QGuiApplication.palette().background().color()
Re: how can I get the font color and background of the FC used theme
@openBrain
thanks for the code, but it seems it doesn't change changing the FC theme...
I cannot detect the font and background FC theme data...
with no theme:
with i.e. ProDark theme:
thanks for the code, but it seems it doesn't change changing the FC theme...
I cannot detect the font and background FC theme data...
with no theme:
Code: Select all
from PySide2 import QtGui
QtGui.QGuiApplication.palette().text().color()
PySide2.QtGui.QColor.fromRgbF(0.000000, 0.000000, 0.000000, 1.000000)
QtGui.QGuiApplication.palette().background().color()
PySide2.QtGui.QColor.fromRgbF(0.941176, 0.941176, 0.941176, 1.000000)
Code: Select all
QtGui.QGuiApplication.palette().text().color()
PySide2.QtGui.QColor.fromRgbF(0.000000, 0.000000, 0.000000, 1.000000)
QtGui.QGuiApplication.palette().background().color()
PySide2.QtGui.QColor.fromRgbF(0.941176, 0.941176, 0.941176, 1.000000)
Re: how can I get the font color and background of the FC used theme
Maybe theme only change at main window level. Could you try ?
Code: Select all
Gui.getMainWindow().palette().text().color()
Gui.getMainWindow().palette().background().color()
Re: how can I get the font color and background of the FC used theme
thanks a lot! that was the way