            color == NS_RGBA(0, 0, 0, 0)) {
          // Use the strictest match for 'transparent' so we do correct
          // round-tripping of all other rgba() values.
-@@ -1397,31 +1404,42 @@ nsCSSValue::AppendToString(nsCSSProperty
+@@ -1397,31 +1408,62 @@ nsCSSValue::AppendToString(nsCSSProperty
          uint8_t a = NS_GET_A(color);
          bool showAlpha =
            (aSerialization == eNormalized && a < 255) ||

-        aResult.Append(comma);
-        aResult.AppendInt(NS_GET_B(color), 10);
-        if (showAlpha) {
+          aResult.AppendInt(NS_GET_R(color), 10);
           aResult.Append(comma);
-          aResult.AppendFloat(nsStyleUtil::ColorComponentToFloat(a));
+          aResult.AppendInt(NS_GET_G(color), 10);
+          aResult.Append(comma);
+          aResult.AppendInt(NS_GET_B(color), 10);
+          if (showAlpha) {
+            aResult.Append(comma);
+            aResult.AppendFloat(nsStyleUtil::ColorComponentToFloat(a));
+          }
+          aResult.Append(char16_t(')'));
         }
-        aResult.Append(char16_t(')'));
       }

   }
   else if (IsNumericColorUnit(unit)) {
+    bool outputCssNames = false;
+    nsXPIDLCString colorOutputType;
+    nsresult rv;
+    nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
+    if (NS_SUCCEEDED(rv) && prefBranch) {
+      prefBranch->GetBoolPref("bluegriffon.css.colors.names.enabled", &outputCssNames);
+      prefBranch->GetCharPref("bluegriffon.css.colors.type", getter_Copies(colorOutputType));
+    }
+    bool serializeName = false;
+    bool forceHexSerialization = false;
+
     if (aSerialization == eNormalized ||
         unit == eCSSUnit_RGBColor ||
