19 result = QColor(
string.mid(1, 2).
toInt(NULL, 16),
string.mid(3, 2).
toInt(NULL, 16),
20 string.mid(5, 2).
toInt(NULL, 16),
string.mid(7, 2).
toInt(NULL, 16));
35 if (color.isValid()) {
36 result = QString(
"#%1%2%3%4")
37 .arg(color.red(), 2, 16, QChar(
'0'))
38 .arg(color.green(), 2, 16, QChar(
'0'))
39 .arg(color.blue(), 2, 16, QChar(
'0'))
40 .arg(color.alpha(), 2, 16, QChar(
'0'));
44 "Can not convert an invalid color to an RGBA string. There is no string representation " 45 "of an invalid color.",
59 return QRegExp(
"^#[0-9a-fA-F]{8}$");
int toInt(const QString &string)
Global function to convert from a string to an integer.
static QColor fromRGBAString(QString)
Converts a QString to its QColor.
#define _FILEINFO_
Macro for the filename and line number.
A type of error that cannot be classified as any of the other error types.
static QRegExp colorRGBAFormat()
Get the colorRGBAFormat.
static QString toRGBAString(QColor)
Convert a QColor to its QString.
Namespace for ISIS/Bullet specific routines.