Open uranusjr opened 10 years ago
Extracted from #77.
RGBA 與 QColor 的互換是 lossless,可行。Qt 本身在把 QColor 轉成 QVariant 時似乎本來就會用 RGB,所以直接 QColor->QVariant->QString 就會是 #RRGGBB 的格式,而這剛好(?) 也是 QColor 的 name 格式。不管是哪種,反正
QColor
QVariant
QColor->QVariant->QString
#RRGGBB
QVariant v = [read color from settings...]; return QColor(v.toString());
這樣似乎保證可以。
Extracted from #77.
RGBA 與 QColor 的互換是 lossless,可行。Qt 本身在把
QColor
轉成QVariant
時似乎本來就會用 RGB,所以直接QColor->QVariant->QString
就會是#RRGGBB
的格式,而這剛好(?) 也是QColor
的 name 格式。不管是哪種,反正這樣似乎保證可以。