0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

isDarkColor function has been added

This commit is contained in:
Arin Alexander 2018-04-04 00:20:14 +03:00
parent 0011744923
commit dd94689f41
4 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -101,6 +101,7 @@ namespace Const{
QString escapeSimbols(const QString& value);
QString replaceHTMLSymbols(const QString &value);
QVector<QString> normalizeCaptures(const QRegExp &reg);
bool isColorDark(QColor color);
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
enum RenderPass {FirstPass = 1, SecondPass = 2};

View File

@ -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

View File

@ -101,6 +101,7 @@ namespace Const{
QString escapeSimbols(const QString& value);
QString replaceHTMLSymbols(const QString &value);
QVector<QString> normalizeCaptures(const QRegExp &reg);
bool isColorDark(QColor color);
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
enum RenderPass {FirstPass = 1, SecondPass = 2};