private static void WriteElementStart(string elementName,
            Color foreground,
            Color background,
            TextWriter writer)
        {
            writer.Write("<{0}", elementName);

            if (foreground != Color.Empty ||
                background != Color.Empty) {
                writer.Write(" style=\"");

                if (foreground != Color.Empty)
                    writer.Write("color:{0};", foreground.ToHtmlColor());

                if (background != Color.Empty)
                    writer.Write("background-color:{0};", background.ToHtmlColor());

                writer.Write("\"");
            }

            writer.Write(">");
        }