]> git.sesse.net Git - kdenlive/blobdiff - src/choosecolorwidget.cpp
Add background property to rotate filter so that
[kdenlive] / src / choosecolorwidget.cpp
index 86138195450f47ea95432f8e63519780e71dd82e..26c18743e649ab9455c58669647ca5da7a496738 100644 (file)
@@ -33,7 +33,6 @@ static QColor stringToColor(QString strColor)
     bool ok = false;
     QColor color("black");
     int intval = 0;
-
     if (strColor.startsWith("0x")) {
         if (strColor.length() == 10) {
             // 0xRRGGBBAA
@@ -55,6 +54,10 @@ static QColor stringToColor(QString strColor)
                           ( intval >>  8 ) & 0xff,   // g
                           ( intval       ) & 0xff,   // b
                           ( intval >> 24 ) & 0xff ); // a
+       } else if (strColor.length() == 8) {
+           // 0xRRGGBB
+           strColor = strColor.replace('#', "0x");
+           color.setNamedColor(strColor);
         } else {
             // #RRGGBB, #RGB
             color.setNamedColor(strColor);
@@ -68,17 +71,16 @@ static QString colorToString(QColor color, bool alpha)
 {
     QString colorStr;
     QTextStream stream(&colorStr);
-    stream << "#";
+    stream << "0x";
     stream.setIntegerBase(16);
     stream.setFieldWidth(2);
     stream.setFieldAlignment(QTextStream::AlignRight);
     stream.setPadChar('0');
+    stream <<  color.red() << color.green() << color.blue();
     if(alpha)
     {
         stream << color.alpha();
     }
-    stream <<  color.red() << color.green() << color.blue();
-
     return colorStr;
 }