Index: src/defaults.h
===================================================================
--- src/defaults.h	(revision 7e8e1b444d5c827c0cdd92a27837c05d6f955f3f)
+++ src/defaults.h	(revision 50b614b0ead33f6b36d2ebb87a0d05d59047c955)
@@ -115,6 +115,6 @@
 //! Default table border color
 #define DEF_TABLE_COLOR QPalette().color(QPalette::AlternateBase)
-//! Default solution background color
-#define DEF_BACKGROUND_COLOR QPalette().color(QPalette::Base)
+////! Default solution background color
+//#define DEF_BACKGROUND_COLOR QPalette().color(QPalette::Base)
 
 #ifndef QT_NO_PRINTER
Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision 7e8e1b444d5c827c0cdd92a27837c05d6f955f3f)
+++ src/mainwindow.cpp	(revision 50b614b0ead33f6b36d2ebb87a0d05d59047c955)
@@ -303,4 +303,9 @@
 
         html.replace(QRegExp("font-family:([^;]*);"), "font-family:\\1, 'DejaVu Sans Mono', 'Courier New', Courier, monospace;");
+        html.replace(QRegExp("<style ([^>]*)>"), QString("<style \\1>\n"
+                                                         "body { color: %1 }\n"
+                                                         "td { border-style: solid; border-width: 1px; border-color: %2; }")
+                     .arg(settings->value("Output/Colors/Font", DEF_TEXT_COLOR).toString(),
+                          settings->value("Output/Colors/TableBorder", DEF_TABLE_COLOR).toString()));
 
         if (!graph.isNull()) {
@@ -1002,6 +1007,6 @@
         pic.end();
 
-QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_RGB32);
-        i.fill(0xFFFFFF);
+        QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_ARGB32);
+        i.fill(QColor(255, 255, 255, 0));
         pic.begin(&i);
         pic.drawPicture(1, 1, graph);
@@ -1319,6 +1324,4 @@
 
     settings->endGroup();
-
-    solutionText->setTextColor(color);
 }
 
Index: src/settingsdialog.cpp
===================================================================
--- src/settingsdialog.cpp	(revision 7e8e1b444d5c827c0cdd92a27837c05d6f955f3f)
+++ src/settingsdialog.cpp	(revision 50b614b0ead33f6b36d2ebb87a0d05d59047c955)
@@ -52,5 +52,5 @@
     buttonAlternateColor->setIcon(GET_ICON("format-text-color"));
     buttonBorderColor->setIcon(GET_ICON("format-stroke-color"));
-    buttonBgColor->setIcon(GET_ICON("format-fill-color"));
+//    buttonBgColor->setIcon(GET_ICON("format-fill-color"));
     buttonFont->setIcon(GET_ICON("preferences-desktop-font"));
     buttonHelp->setIcon(GET_ICON("help-hint"));
@@ -217,4 +217,8 @@
     connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked()));
     connect(buttonTextColor, SIGNAL(clicked()), SLOT(buttonTextColorClicked()));
+    connect(buttonSelectedColor, SIGNAL(clicked()), SLOT(buttonSelectedColorClicked()));
+    connect(buttonAlternateColor, SIGNAL(clicked()), SLOT(buttonAlternateColorClicked()));
+    connect(buttonBorderColor, SIGNAL(clicked()), SLOT(buttonBorderColorClicked()));
+//    connect(buttonBgColor, SIGNAL(clicked()), SLOT(buttonBgColorClicked()));
     setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
 #if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD)
@@ -295,6 +299,6 @@
     selColor = QColor(settings->value("Colors/Selected", DEF_SELECTED_COLOR).toString());
     altColor = QColor(settings->value("Colors/Alternate", DEF_ALTERNATE_COLOR).toString());
-    borderColor = QColor(settings->value("Colors/Border", DEF_TABLE_COLOR).toString());
-    bgColor = QColor(settings->value("Colors/Background", DEF_BACKGROUND_COLOR).toString());
+    borderColor = QColor(settings->value("Colors/TableBorder", DEF_TABLE_COLOR).toString());
+//    bgColor = QColor(settings->value("Colors/Background", DEF_BACKGROUND_COLOR).toString());
     settings->endGroup();
 
@@ -304,23 +308,9 @@
     labelFontExample->setText(font.family());
 
-    p = boxTextColor->palette();
-    p.setColor(QPalette::Window, textColor);
-    boxTextColor->setPalette(p);
-
-    p = boxSelectedColor->palette();
-    p.setColor(QPalette::Window, selColor);
-    boxSelectedColor->setPalette(p);
-
-    p = boxAlternateColor->palette();
-    p.setColor(QPalette::Window, altColor);
-    boxAlternateColor->setPalette(p);
-
-    p = boxBorderColor->palette();
-    p.setColor(QPalette::Window, borderColor);
-    boxBorderColor->setPalette(p);
-
-    p = boxBgColor->palette();
-    p.setColor(QPalette::Window, bgColor);
-    boxBgColor->setPalette(p);
+    setBgColor(boxTextColor, textColor);
+    setBgColor(boxSelectedColor, selColor);
+    setBgColor(boxAlternateColor, altColor);
+    setBgColor(boxBorderColor, borderColor);
+//    setBgColor(boxBgColor, bgColor);
 
 #ifdef HANDHELD
@@ -427,18 +417,77 @@
     if (_fontChanged)
         settings->setValue("Font", font);
-    if (_colorChanged)
-        settings->setValue("Colors/Text", textColor.name());
+    if (_colorChanged) {
+        settings->beginGroup("Colors");
+        if (textColor != DEF_TEXT_COLOR)
+            settings->setValue("Text", textColor.name());
+        else
+            settings->remove("Text");
+        if (selColor != QColor(DEF_SELECTED_COLOR))
+            settings->setValue("Selected", selColor.name());
+        else
+            settings->remove("Selected");
+        if (altColor != DEF_ALTERNATE_COLOR)
+            settings->setValue("Alternate",altColor.name());
+        else
+            settings->remove("Alternate");
+        if (borderColor != DEF_TABLE_COLOR)
+            settings->setValue("TableBorder", borderColor.name());
+        else
+            settings->remove("TableColor");
+//        if (bgColor != DEF_BACKGROUND_COLOR)
+//            settings->setValue("Background", bgColor.name());
+//        else
+//            settings->remove("Background");
+        settings->endGroup();
+    }
     settings->endGroup();
     QDialog::accept();
 }
 
+void SettingsDialog::pickColor(QColor &where)
+{
+    QColor color = QColorDialog::getColor(where, this);
+    if (color.isValid() && (where != color)) {
+        where = color;
+        _colorChanged = true;
+    }
+}
+
+void SettingsDialog::setBgColor(QWidget *widget, const QColor &color)
+{
+    QPalette p = widget->palette();
+    p.setColor(QPalette::Window, color);
+    widget->setPalette(p);
+}
+
 void SettingsDialog::buttonTextColorClicked()
 {
-QColor color = QColorDialog::getColor(this->textColor,this);
-    if (color.isValid() && (this->textColor != color)) {
-        this->textColor = color;
-        _colorChanged = true;
-    }
-}
+    pickColor(textColor);
+    setBgColor(boxTextColor, textColor);
+}
+
+void SettingsDialog::buttonSelectedColorClicked()
+{
+    pickColor(selColor);
+    setBgColor(boxSelectedColor, selColor);
+}
+
+void SettingsDialog::buttonAlternateColorClicked()
+{
+    pickColor(altColor);
+    setBgColor(boxAlternateColor, altColor);
+}
+
+void SettingsDialog::buttonBorderColorClicked()
+{
+    pickColor(borderColor);
+    setBgColor(boxBorderColor, borderColor);
+}
+
+//void SettingsDialog::buttonBgColorClicked()
+//{
+//    pickColor(bgColor);
+//    setBgColor(boxBgColor, bgColor);
+//}
 
 void SettingsDialog::buttonFontClicked()
Index: src/settingsdialog.h
===================================================================
--- src/settingsdialog.h	(revision 7e8e1b444d5c827c0cdd92a27837c05d6f955f3f)
+++ src/settingsdialog.h	(revision 50b614b0ead33f6b36d2ebb87a0d05d59047c955)
@@ -72,4 +72,7 @@
     QLabel *labelHint;
 
+    void pickColor(QColor &where);
+    void setBgColor(QWidget *widget, const QColor &color);
+
 #ifndef QT_NO_STATUSTIP
     bool event(QEvent *ev);
@@ -80,4 +83,8 @@
     void accept();
     void buttonTextColorClicked();
+    void buttonSelectedColorClicked();
+    void buttonAlternateColorClicked();
+    void buttonBorderColorClicked();
+//    void buttonBgColorClicked();
     void buttonFontClicked();
 #ifdef Q_WS_WINCE_WM
