46 if( color_string.indexOf(
';' ) != -1 )
48 QStringList strings = color_string.split(
';' );
49 if( strings.size() >= 3 )
52 int r = strings[ 0 ].toInt( &r_ok );
54 int g = strings[ 1 ].toInt( &g_ok );
56 int b = strings[ 2 ].toInt( &b_ok );
57 if( r_ok && g_ok && b_ok )
66 if( QColor::colorNames().contains( color_string, Qt::CaseInsensitive ) ||
67 (color_string.size() > 0 && color_string[ 0 ] ==
'#' ))
69 new_color.setNamedColor( color_string.toLower() );
76 return QString(
"%1; %2; %3" )
84 return QColor::fromRgbF( c.r, c.g, c.b, c.a );
89 return Ogre::ColourValue( c.redF(), c.greenF(), c.blueF(), c.alphaF() );
Ogre::ColourValue qtToOgre(const QColor &c)
QColor ogreToQt(const Ogre::ColourValue &c)
QColor parseColor(const QString &color_string)
QString printColor(const QColor &color)