mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 20:31:04 +03:00
isDarkColor function has been added
This commit is contained in:
parent
0011744923
commit
dd94689f41
@ -76,4 +76,13 @@ QVector<QString> normalizeCaptures(const QRegExp& reg){
|
|||||||
return result;
|
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
|
} //namespace LimeReport
|
||||||
|
@ -101,6 +101,7 @@ namespace Const{
|
|||||||
QString escapeSimbols(const QString& value);
|
QString escapeSimbols(const QString& value);
|
||||||
QString replaceHTMLSymbols(const QString &value);
|
QString replaceHTMLSymbols(const QString &value);
|
||||||
QVector<QString> normalizeCaptures(const QRegExp ®);
|
QVector<QString> normalizeCaptures(const QRegExp ®);
|
||||||
|
bool isColorDark(QColor color);
|
||||||
|
|
||||||
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
|
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
|
||||||
enum RenderPass {FirstPass = 1, SecondPass = 2};
|
enum RenderPass {FirstPass = 1, SecondPass = 2};
|
||||||
|
@ -76,4 +76,13 @@ QVector<QString> normalizeCaptures(const QRegExp& reg){
|
|||||||
return result;
|
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
|
} //namespace LimeReport
|
||||||
|
@ -101,6 +101,7 @@ namespace Const{
|
|||||||
QString escapeSimbols(const QString& value);
|
QString escapeSimbols(const QString& value);
|
||||||
QString replaceHTMLSymbols(const QString &value);
|
QString replaceHTMLSymbols(const QString &value);
|
||||||
QVector<QString> normalizeCaptures(const QRegExp ®);
|
QVector<QString> normalizeCaptures(const QRegExp ®);
|
||||||
|
bool isColorDark(QColor color);
|
||||||
|
|
||||||
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
|
enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols};
|
||||||
enum RenderPass {FirstPass = 1, SecondPass = 2};
|
enum RenderPass {FirstPass = 1, SecondPass = 2};
|
||||||
|
Loading…
Reference in New Issue
Block a user