Solved!
It works if the style sheet is used rather than a QPalette.
This code makes its job (RGB values are just an example):
import PySide2, RLPy
from PySide2 import *
from PySide2.shiboken2 import wrapInstance
#-- Make a global variable contain dialog --#
sample_dialog = None
def run_script():
global sample_dialog
sample_dialog = RLPy.RUi.CreateRDialog()
sample_dialog.SetWindowTitle("Sample Dialog")
#-- Create Pyside layout for RDialog --#
pyside_dialog = wrapInstance(int(sample_dialog.GetWindow()), PySide2.QtWidgets.QDialog)
pyside_dialog.setFixedWidth(200)
sample_layout = pyside_dialog.layout()
#-- Create the Label --#
label = PySide2.QtWidgets.QLabel("Test")
col = PySide2.QtGui.QColor(111, 100, 8)
label.setStyleSheet("QWidget { background-color: %s }" % col.name())
#-- Add Label --#
sample_layout.addWidget(label)
sample_dialog.Show()
My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390 RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB / SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12