zz_colorSelectDialog.cpp

changeset 116
4fde8fdf258a
parent 104
6e29bb0e83c5
child 135
c243df39913e
equal deleted inserted replaced
115:611417d3e6d2 116:4fde8fdf258a
118 uchar ucLuma = (0.2126f * qColor.red()) + 118 uchar ucLuma = (0.2126f * qColor.red()) +
119 (0.7152f * qColor.green()) + (0.0722f * qColor.blue()); 119 (0.7152f * qColor.green()) + (0.0722f * qColor.blue());
120 bool bDark = (ucLuma < 80); 120 bool bDark = (ucLuma < 80);
121 121
122 qScene->addRect (x, y, w, w, qPen, qColor); 122 qScene->addRect (x, y, w, w, qPen, qColor);
123 QGraphicsTextItem* qText = qScene->addText (str::mkfmt ("%lu", i).chars()); 123 QGraphicsTextItem* qText = qScene->addText (format ("%lu", i).chars());
124 qText->setDefaultTextColor ((bDark) ? Qt::white : Qt::black); 124 qText->setDefaultTextColor ((bDark) ? Qt::white : Qt::black);
125 qText->setPos (x, y); 125 qText->setPos (x, y);
126 126
127 if (i == dSelColor) { 127 if (i == dSelColor) {
128 QGraphicsPixmapItem* qCursorPic; 128 QGraphicsPixmapItem* qCursorPic;
141 if (dSelColor == -1 || !col) { 141 if (dSelColor == -1 || !col) {
142 qColorInfo->setText ("---"); 142 qColorInfo->setText ("---");
143 return; 143 return;
144 } 144 }
145 145
146 qColorInfo->setText (str::mkfmt ("%d - %s", 146 qColorInfo->setText (format ("%d - %s",
147 dSelColor, col->zName.chars())); 147 dSelColor, col->zName.chars()));
148 } 148 }
149 149
150 // ============================================================================= 150 // =============================================================================
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

mercurial