mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-25 00:03:42 +00:00
Expose getLuminance for QColor
This commit is contained in:
2 files changed
+2
-1
No files matched your search
@@ -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