mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-10-09 05:57:15 +03:00
isDarkColor function has been added
This commit is contained in:
@@ -76,4 +76,13 @@ QVector<QString> normalizeCaptures(const QRegExp& reg){
|
||||
return result;
|
||||
}
|
||||
|
||||
bool isColorDark(QColor color){
|
||||
qreal darkness = 1-(0.299*color.red() + 0.587*color.green() + 0.114*color.blue())/255;
|
||||
if(darkness<0.5){
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace LimeReport
|
||||
|
Reference in New Issue
Block a user