57 { |
57 { |
58 color = QColor (m_config->mainColor()); |
58 color = QColor (m_config->mainColor()); |
59 color.setAlphaF (m_config->mainColorAlpha()); |
59 color.setAlphaF (m_config->mainColorAlpha()); |
60 } |
60 } |
61 |
61 |
62 QString color2name (Luma (color) < 80 ? "white" : "black"); |
62 QString color2name (luma (color) < 80 ? "white" : "black"); |
63 button->setAutoFillBackground (true); |
63 button->setAutoFillBackground (true); |
64 button->setStyleSheet (format ("background-color: rgba(%1, %2, %3, %4); color: %5", |
64 button->setStyleSheet (format ("background-color: rgba(%1, %2, %3, %4); color: %5", |
65 color.red(), color.green(), color.blue(), color.alpha(), color2name)); |
65 color.red(), color.green(), color.blue(), color.alpha(), color2name)); |
66 button->setCheckable (true); |
66 button->setCheckable (true); |
67 button->setText (QString::number (ldcolor.index())); |
67 button->setText (QString::number (ldcolor.index())); |