Avoid unnecessary QColor -> QString conversions
This commit is contained in:
parent
ca91e9d0d1
commit
0a833b6e9b
3 changed files with 6 additions and 8 deletions
|
|
@ -679,11 +679,10 @@ utils::hashQString(const QString &input)
|
|||
return hash;
|
||||
}
|
||||
|
||||
QString
|
||||
utils::generateContrastingHexColor(const QString &input, const QString &background)
|
||||
QColor
|
||||
utils::generateContrastingHexColor(const QString &input, const QColor &backgroundCol)
|
||||
{
|
||||
const QColor backgroundCol(background);
|
||||
const qreal backgroundLum = luminance(background);
|
||||
const qreal backgroundLum = luminance(backgroundCol);
|
||||
|
||||
// Create a color for the input
|
||||
auto hash = hashQString(input);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue