mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Expose getLuminance for QColor
This commit is contained in:
@@ -1061,7 +1061,7 @@ QString GetSystemUsername()
|
||||
return username;
|
||||
}
|
||||
|
||||
static float getLuminance(const QColor &col)
|
||||
float getLuminance(const QColor &col)
|
||||
{
|
||||
return (float)(0.2126 * qPow(col.redF(), 2.2) + 0.7152 * qPow(col.greenF(), 2.2) +
|
||||
0.0722 * qPow(col.blueF(), 2.2));
|
||||
|
||||
@@ -892,4 +892,5 @@ void setEnabledMultiple(const QList<QWidget *> &widgets, bool enabled);
|
||||
|
||||
QString GetSystemUsername();
|
||||
|
||||
float getLuminance(const QColor &col);
|
||||
QColor contrastingColor(const QColor &col, const QColor &defaultCol);
|
||||
|
||||
Reference in New Issue
Block a user