changeset 677:b6ef23efdac7

always use shaded colors This makes things much simpler and improves sharing of colors. If computing two more shades really proves to be a performance issue, we can shade on demand without exposing this optimization to the interface.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Thu, 11 Dec 2008 23:31:03 +0100
parents c15c4ad6d847
children d8829df904cf
files dw/fltkplatform.cc dw/fltkplatform.hh dw/layout.hh dw/platform.hh dw/style.cc dw/style.hh dw/textblock.cc src/form.cc src/html.cc src/plain.cc src/styleengine.cc src/web.cc test/dw_anchors_test.cc test/dw_border_test.cc test/dw_example.cc test/dw_find_test.cc test/dw_images_scaled.cc test/dw_images_scaled2.cc test/dw_images_simple.cc test/dw_links.cc test/dw_links2.cc test/dw_lists.cc test/dw_resource_test.cc test/dw_table.cc test/dw_table_aligned.cc test/dw_ui_test.cc
diffstat 26 files changed, 98 insertions(+), 150 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkplatform.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/fltkplatform.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -101,11 +101,9 @@
       new container::typed::HashTable <dw::core::style::ColorAttrs,
                                        FltkColor> (false, false);
 
-FltkColor::FltkColor (int color, core::style::Color::Type type):
-   Color (color, type)
+FltkColor::FltkColor (int color): Color (color)
 {
    this->color = color;
-   this->type = type;
 
    /*
     * fltk/setcolor.cxx:
@@ -123,13 +121,10 @@
       colors[SHADING_NORMAL] = ::fltk::BLACK;
    if (!(colors[SHADING_INVERSE] = shadeColor (color, SHADING_INVERSE) << 8))
       colors[SHADING_INVERSE] = ::fltk::BLACK;
-
-   if(type == core::style::Color::TYPE_SHADED) {
-      if (!(colors[SHADING_DARK] = shadeColor (color, SHADING_DARK) << 8))
-         colors[SHADING_DARK] = ::fltk::BLACK;
-      if (!(colors[SHADING_LIGHT] = shadeColor (color, SHADING_LIGHT) << 8))
-         colors[SHADING_LIGHT] = ::fltk::BLACK;
-   }
+   if (!(colors[SHADING_DARK] = shadeColor (color, SHADING_DARK) << 8))
+      colors[SHADING_DARK] = ::fltk::BLACK;
+   if (!(colors[SHADING_LIGHT] = shadeColor (color, SHADING_LIGHT) << 8))
+      colors[SHADING_LIGHT] = ::fltk::BLACK;
 }
 
 FltkColor::~FltkColor ()
@@ -137,13 +132,13 @@
    colorsTable->remove (this);
 }
 
-FltkColor * FltkColor::create (int col, core::style::Color::Type type)
+FltkColor * FltkColor::create (int col)
 {
-   ColorAttrs attrs(col, type);
+   ColorAttrs attrs(col);
    FltkColor *color = colorsTable->get (&attrs);
 
    if (color == NULL) {
-      color = new FltkColor (col, type);
+      color = new FltkColor (col);
       colorsTable->put (color, color);
    }
 
@@ -385,14 +380,9 @@
    return FltkFont::create (attrs);
 }
 
-core::style::Color *FltkPlatform::createSimpleColor (int color)
+core::style::Color *FltkPlatform::createColor (int color)
 {
-   return FltkColor::create (color, core::style::Color::TYPE_SIMPLE);
-}
-
-core::style::Color *FltkPlatform::createShadedColor (int color)
-{
-   return FltkColor::create (color, core::style::Color::TYPE_SHADED);
+   return FltkColor::create (color);
 }
 
 void FltkPlatform::copySelection(const char *text)
--- a/dw/fltkplatform.hh	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/fltkplatform.hh	Thu Dec 11 23:31:03 2008 +0100
@@ -34,13 +34,13 @@
    static lout::container::typed::HashTable <dw::core::style::ColorAttrs,
                                        FltkColor> *colorsTable;
 
-   FltkColor (int color, core::style::Color::Type type);
+   FltkColor (int color);
    ~FltkColor ();
 
 public:
    int colors[SHADING_NUM];
 
-   static FltkColor *create(int color, core::style::Color::Type type);
+   static FltkColor *create(int color);
 };
 
 
@@ -133,8 +133,7 @@
    
    core::style::Font *createFont (core::style::FontAttrs *attrs,
                                       bool tryEverything);
-   core::style::Color *createSimpleColor (int color);
-   core::style::Color *createShadedColor (int color);
+   core::style::Color *createColor (int color);
    
    core::Imgbuf *createImgbuf (core::Imgbuf::Type type, int width, int height);
 
--- a/dw/layout.hh	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/layout.hh	Thu Dec 11 23:31:03 2008 +0100
@@ -231,14 +231,9 @@
       return  platform->createFont (attrs, tryEverything);
    }
 
-   inline style::Color *createSimpleColor (int color)
+   inline style::Color *createColor (int color)
    {
-      return platform->createSimpleColor (color);
-   }
-
-   inline style::Color *createShadedColor (int color)
-   {
-      return platform->createShadedColor (color);
+      return platform->createColor (color);
    }
 
    inline Imgbuf *createImgbuf (Imgbuf::Type type, int width, int height)
--- a/dw/platform.hh	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/platform.hh	Thu Dec 11 23:31:03 2008 +0100
@@ -120,15 +120,9 @@
                                     bool tryEverything) = 0;
  
    /**
-    * \brief Create a simple color resource for a given 0xrrggbb value.
+    * \brief Create a color resource for a given 0xrrggbb value.
     */
-   virtual style::Color *createSimpleColor (int color) = 0;
-
-   /**
-    * \brief Create a shaded color resource for a given 0xrrggbb value.
-    */
-   virtual style::Color *createShadedColor (int color) = 0;
-
+   virtual style::Color *createColor (int color) = 0;
 
    /*
     * --------------------
--- a/dw/style.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/style.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -334,12 +334,12 @@
 bool ColorAttrs::equals(object::Object *other)
 {
    ColorAttrs *oc = (ColorAttrs*)other;
-   return this == oc || (color == oc->color && type == oc->type);
+   return this == oc || (color == oc->color);
 }
 
 int ColorAttrs::hashValue()
 {
-   return color ^ type;
+   return color;
 }
 
 Color::~Color ()
@@ -403,21 +403,11 @@
 }
 
   
-Color *Color::create (Layout *layout, int col, Type type)
+Color *Color::create (Layout *layout, int col)
 {
-   ColorAttrs attrs(col, type);
-   Color *color = NULL;
+   ColorAttrs attrs(col);
 
-   switch (type) {
-      case TYPE_SIMPLE:
-         color = layout->createSimpleColor (col);
-         break;
-      case TYPE_SHADED:
-         color = layout->createShadedColor (col);
-         break;
-   }
-
-   return color;
+   return layout->createColor (col);
 }
 
 // ----------------------------------------------------------------------
--- a/dw/style.hh	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/style.hh	Thu Dec 11 23:31:03 2008 +0100
@@ -591,22 +591,16 @@
  */
 class ColorAttrs: public object::Object
 {
-public:
-   enum Type { TYPE_SIMPLE, TYPE_SHADED };
-
 protected:
    int color;
-   Type type;
 
 public:
-   inline ColorAttrs(int color, Type type)
+   inline ColorAttrs(int color)
    {
       this->color = color;
-      this->type = type;
    }
 
    inline int getColor () { return color; }
-   inline Type getType () { return type; }
 
    bool equals(object::Object *other);
    int hashValue();
@@ -621,12 +615,11 @@
 private:
    int refCount;
 
-   static Color *create (Layout *layout, int color, Type type);
    void remove(dw::core::Layout *layout);
-    int shadeColor (int color, int d);
+   int shadeColor (int color, int d);
 
 protected:
-   inline Color (int color, Type type): ColorAttrs (color, type) {
+   inline Color (int color): ColorAttrs (color) {
       refCount = 0; }
    virtual ~Color ();
 
@@ -638,15 +631,7 @@
    int shadeColor (int color, Shading shading);
 
 public:
-   inline static Color *createSimple (Layout *layout, int color)
-   {
-      return create (layout, color, TYPE_SIMPLE);
-   }
-
-   inline static Color *createShaded (Layout *layout, int color)
-   {
-      return create (layout, color, TYPE_SHADED);
-   }
+   static Color *create (Layout *layout, int color);
 
    inline void ref () { refCount++; }
    inline void unref ()
--- a/dw/textblock.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/dw/textblock.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -1921,14 +1921,14 @@
             case core::Content::TEXT:
             {  core::style::Style *old_style = word->style;
                styleAttrs = *old_style;
-               styleAttrs.color = core::style::Color::createSimple (layout,
-                                                                    newColor);
+               styleAttrs.color = core::style::Color::create (layout,
+                                                              newColor);
                word->style = core::style::Style::create (layout, &styleAttrs);
                old_style->unref();
                old_style = word->spaceStyle;
                styleAttrs = *old_style;
-               styleAttrs.color = core::style::Color::createSimple (layout,
-                                                                    newColor);
+               styleAttrs.color = core::style::Color::create (layout,
+                                                              newColor);
                word->spaceStyle =
                                core::style::Style::create(layout, &styleAttrs);
                old_style->unref();
@@ -1937,10 +1937,10 @@
             case core::Content::WIDGET:
             {  core::Widget *widget = word->content.widget;
                styleAttrs = *widget->getStyle();
-               styleAttrs.color = core::style::Color::createSimple (layout,
-                                                                    newColor);
+               styleAttrs.color = core::style::Color::create (layout,
+                                                              newColor);
                styleAttrs.setBorderColor(
-                           core::style::Color::createShaded(layout, newColor));
+                           core::style::Color::create (layout, newColor));
                widget->setStyle(
                              core::style::Style::create (layout, &styleAttrs));
                break;
--- a/src/form.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/src/form.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -537,7 +537,7 @@
       if (prefs.standard_widget_colors)
          bg = NULL;
       else
-         bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
+         bg = Color::create (HT2LT(html), S_TOP(html)->current_bg_color);
       HTML_SET_TOP_ATTR(html, backgroundColor, bg);
 
       DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
@@ -587,7 +587,7 @@
    if (prefs.standard_widget_colors)
       bg = NULL;
    else
-      bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
+      bg = Color::create (HT2LT(html), S_TOP(html)->current_bg_color);
    HTML_SET_TOP_ATTR(html, backgroundColor, bg);
    DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
 
@@ -655,7 +655,7 @@
    if (prefs.standard_widget_colors)
       bg = NULL;
    else
-      bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
+      bg = Color::create (HT2LT(html), S_TOP(html)->current_bg_color);
    HTML_SET_TOP_ATTR(html, backgroundColor, bg);
 
    DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
@@ -866,7 +866,7 @@
       style_attrs.borderWidth.setVal(0);
       style_attrs.padding.setVal(0);
       style_attrs.backgroundColor =
-               Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
+               Color::create (HT2LT(html), S_TOP(html)->current_bg_color);
       style = Style::create (HT2LT(html), &style_attrs);
 
       page = new Textblock (prefs.limit_text_width);
@@ -1911,7 +1911,7 @@
       style_attrs = *html->styleEngine->style ();
       style_attrs.cursor = CURSOR_POINTER;
       style_attrs.backgroundColor =
-        style::Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
+        style::Color::create (HT2LT(html), S_TOP(html)->current_bg_color);
 
       /* create new image and add it to the button */
       if ((Image = a_Html_add_new_image(html, tag, tagsize, url, &style_attrs,
--- a/src/html.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/src/html.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -1766,9 +1766,9 @@
 
    if (a_Capi_get_flags(url) & CAPI_IsCached) { /* visited frame */
       style_attrs.color =
-         Color::createSimple (HT2LT(html), html->visited_color);
+         Color::create (HT2LT(html), html->visited_color);
    } else {                                    /* unvisited frame */
-      style_attrs.color = Color::createSimple (HT2LT(html), html->link_color);
+      style_attrs.color = Color::create (HT2LT(html), html->link_color);
    }
    style_attrs.textDecoration |= TEXT_DECORATION_UNDERLINE;
    style_attrs.x_link = Html_set_new_link(html, &url);
@@ -2136,10 +2136,10 @@
       if (html->styleEngine->style ()->x_link != -1) {
          /* In this case we can use the text color */
          style_attrs.setBorderColor (
-            Color::createShaded (HT2LT(html), style_attrs.color->getColor()));
+            Color::create (HT2LT(html), style_attrs.color->getColor()));
       } else {
          style_attrs.setBorderColor (
-            Color::createShaded (HT2LT(html), html->link_color));
+            Color::create (HT2LT(html), html->link_color));
       }
       style_attrs.setBorderStyle (BORDER_SOLID);
       style_attrs.borderWidth.setVal (border);
@@ -2336,7 +2336,7 @@
       style_attrs = *html->styleEngine->style ();
 
       if (a_Capi_get_flags(url) & CAPI_IsCached) {
-         style_attrs.color = Color::createSimple (
+         style_attrs.color = Color::create (
             HT2LT(html),
             html->visited_color
 /*
@@ -2348,8 +2348,7 @@
 */
             );
       } else {
-         style_attrs.color = Color::createSimple(HT2LT(html),
-                                                 html->link_color);
+         style_attrs.color = Color::create (HT2LT(html), html->link_color);
       }
 
       style_attrs.textDecoration |= TEXT_DECORATION_UNDERLINE;
--- a/src/plain.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/src/plain.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -108,9 +108,9 @@
    styleAttrs.initValues ();
    styleAttrs.margin.setVal (5);
    styleAttrs.font = style::Font::create (layout, &fontAttrs);
-   styleAttrs.color = style::Color::createSimple (layout, prefs.text_color);
+   styleAttrs.color = style::Color::create (layout, prefs.text_color);
    styleAttrs.backgroundColor = 
-      style::Color::createSimple (layout, prefs.bg_color);
+      style::Color::create (layout, prefs.bg_color);
    widgetStyle = style::Style::create (layout, &styleAttrs);
 
    /* The context menu */
--- a/src/styleengine.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/src/styleengine.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -35,8 +35,8 @@
  
    style_attrs.initValues ();
    style_attrs.font = Font::create (layout, &font_attrs);
-   style_attrs.color = Color::createSimple (layout, 0);
-   style_attrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   style_attrs.color = Color::create (layout, 0);
+   style_attrs.backgroundColor = Color::create (layout, 0xffffff);
    
    n->style = Style::create (layout, &style_attrs);
 }
@@ -196,23 +196,23 @@
          /* \todo missing cases */
          case CssProperty::CSS_PROPERTY_BACKGROUND_COLOR:
             attrs->backgroundColor =
-               Color::createSimple (layout, p->value.intVal);
+               Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_BORDER_TOP_COLOR:
             attrs->borderColor.top =
-              Color::createShaded (layout, p->value.intVal);
+              Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_BORDER_BOTTOM_COLOR:
             attrs->borderColor.bottom =
-              Color::createShaded (layout, p->value.intVal);
+              Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_BORDER_LEFT_COLOR:
             attrs->borderColor.left =
-              Color::createShaded (layout, p->value.intVal);
+              Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_BORDER_RIGHT_COLOR:
             attrs->borderColor.right =
-              Color::createShaded (layout, p->value.intVal);
+              Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_BORDER_BOTTOM_STYLE:
             attrs->borderStyle.bottom = (BorderStyle) p->value.intVal;
@@ -243,7 +243,7 @@
             computeValue (&attrs->vBorderSpacing, p->value.intVal, attrs->font);
             break;
          case CssProperty::CSS_PROPERTY_COLOR:
-            attrs->color = Color::createSimple (layout, p->value.intVal);
+            attrs->color = Color::create (layout, p->value.intVal);
             break; 
          case CssProperty::CSS_PROPERTY_CURSOR:
             attrs->cursor = (Cursor) p->value.intVal;
@@ -307,17 +307,13 @@
 
    /* make sure border colors are set */
    if (attrs->borderColor.top == NULL) 
-      attrs->borderColor.top = Color::createShaded (layout,
-         attrs->color->getColor ());
+      attrs->borderColor.top = attrs->color;
    if (attrs->borderColor.bottom == NULL) 
-      attrs->borderColor.bottom = Color::createShaded (layout,
-         attrs->color->getColor ());
+      attrs->borderColor.bottom = attrs->color;
    if (attrs->borderColor.left == NULL) 
-      attrs->borderColor.left = Color::createShaded (layout,
-         attrs->color->getColor ());
+      attrs->borderColor.left = attrs->color;
    if (attrs->borderColor.right == NULL) 
-      attrs->borderColor.right = Color::createShaded (layout,
-         attrs->color->getColor ());
+      attrs->borderColor.right = attrs->color;
    
 }
 
--- a/src/web.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/src/web.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -80,9 +80,9 @@
       styleAttrs.initValues ();
       styleAttrs.margin.setVal (5);
       styleAttrs.font = style::Font::create (layout, &fontAttrs);
-      styleAttrs.color = style::Color::createSimple (layout, 0xff0000);
+      styleAttrs.color = style::Color::create (layout, 0xff0000);
       styleAttrs.backgroundColor = 
-         style::Color::createSimple (layout, prefs.bg_color);
+         style::Color::create (layout, prefs.bg_color);
       widgetStyle = style::Style::create (layout, &styleAttrs);
       dw->setStyle (widgetStyle);
       widgetStyle->unref ();
--- a/test/dw_anchors_test.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_anchors_test.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -126,8 +126,8 @@
    styleAttrs.initValues ();
    styleAttrs.font = Font::create (layout, &fontAttrs);
    styleAttrs.margin.setVal (5);
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
    topWidgetStyle = Style::create (layout, &styleAttrs);
 
    styleAttrs.margin.left = 20;
--- a/test/dw_border_test.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_border_test.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -49,7 +49,7 @@
    styleAttrs.initValues ();
    styleAttrs.margin.setVal (5);
    styleAttrs.borderWidth.setVal (2);
-   styleAttrs.setBorderColor (Color::createShaded (layout, 0xffffff));
+   styleAttrs.setBorderColor (Color::create (layout, 0xffffff));
    styleAttrs.setBorderStyle (BORDER_INSET);
    styleAttrs.padding.setVal (5);
 
@@ -60,15 +60,15 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle1 = Style::create (layout, &styleAttrs);
 
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffff80);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffff80);
    styleAttrs.margin.setVal (0);
    styleAttrs.borderWidth.setVal (1);
-   styleAttrs.setBorderColor (Color::createSimple (layout, 0x4040ff));
+   styleAttrs.setBorderColor (Color::create (layout, 0x4040ff));
    styleAttrs.setBorderStyle (BORDER_SOLID);
    styleAttrs.padding.setVal (1);
 
--- a/test/dw_example.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_example.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -53,9 +53,9 @@
    styleAttrs.font = dw::core::style::Font::create (layout, &fontAttrs);
 
    styleAttrs.color =
-      dw::core::style::Color::createSimple (layout, 0x000000);
+      dw::core::style::Color::create (layout, 0x000000);
    styleAttrs.backgroundColor =
-      dw::core::style::Color::createSimple (layout, 0xffffff);
+      dw::core::style::Color::create (layout, 0xffffff);
 
    dw::core::style::Style *widgetStyle = 
       dw::core::style::Style::create (layout, &styleAttrs);
--- a/test/dw_find_test.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_find_test.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -99,8 +99,8 @@
    styleAttrs.initValues ();
    styleAttrs.font = Font::create (layout, &fontAttrs);
    styleAttrs.margin.setVal (10);
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
    Style *topWidgetStyle = Style::create (layout, &styleAttrs);
 
    styleAttrs.margin.setVal (0);
--- a/test/dw_images_scaled.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_images_scaled.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -115,8 +115,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
--- a/test/dw_images_scaled2.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_images_scaled2.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -90,8 +90,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
@@ -109,7 +109,7 @@
    Style *wordStyle = Style::create (layout, &styleAttrs);
 
    styleAttrs.borderWidth.setVal (1);
-   styleAttrs.setBorderColor (Color::createShaded (layout, 0x000080));
+   styleAttrs.setBorderColor (Color::create (layout, 0x000080));
    styleAttrs.setBorderStyle (BORDER_SOLID);
    styleAttrs.padding.setVal (1);
    styleAttrs.backgroundColor = NULL;
--- a/test/dw_images_simple.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_images_simple.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -113,8 +113,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
--- a/test/dw_links.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_links.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -91,8 +91,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
@@ -110,7 +110,7 @@
 
    Style *wordStyle = Style::create (layout, &styleAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x0000ff);
+   styleAttrs.color = Color::create (layout, 0x0000ff);
    styleAttrs.textDecoration = TEXT_DECORATION_UNDERLINE;
    styleAttrs.cursor = CURSOR_POINTER;
    
--- a/test/dw_links2.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_links2.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -119,8 +119,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
@@ -138,7 +138,7 @@
 
    Style *wordStyle = Style::create (layout, &styleAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x0000ff);
+   styleAttrs.color = Color::create (layout, 0x0000ff);
    styleAttrs.textDecoration = TEXT_DECORATION_UNDERLINE;
    styleAttrs.cursor = CURSOR_POINTER;
    
--- a/test/dw_lists.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_lists.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -56,8 +56,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
@@ -75,8 +75,8 @@
 
    styleAttrs.margin.setVal (5);
    styleAttrs.padding.setVal (5);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffff40);
-   styleAttrs.setBorderColor (Color::createSimple (layout, 0x000000));
+   styleAttrs.backgroundColor = Color::create (layout, 0xffff40);
+   styleAttrs.setBorderColor (Color::create (layout, 0x000000));
    styleAttrs.setBorderStyle (BORDER_SOLID);
    styleAttrs.borderWidth.setVal (1);
 
--- a/test/dw_resource_test.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_resource_test.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -57,8 +57,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    Style *widgetStyle = Style::create (layout, &styleAttrs);
 
--- a/test/dw_table.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_table.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -51,9 +51,9 @@
    styleAttrs.padding.setVal (0);
    styleAttrs.borderWidth.setVal (1);
    styleAttrs.setBorderStyle (BORDER_OUTSET);
-   styleAttrs.setBorderColor (Color::createShaded (layout, 0xffffff));
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.setBorderColor (Color::create (layout, 0xffffff));
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
    styleAttrs.hBorderSpacing = 5;
    styleAttrs.vBorderSpacing = 5;
 
--- a/test/dw_table_aligned.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_table_aligned.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -50,7 +50,7 @@
    styleAttrs.margin.setVal (5);
    styleAttrs.borderWidth.setVal (1);
    styleAttrs.setBorderStyle (BORDER_OUTSET);
-   styleAttrs.setBorderColor (Color::createShaded (layout, 0x808080));
+   styleAttrs.setBorderColor (Color::create (layout, 0x808080));
 
    FontAttrs fontAttrs;
    fontAttrs.name = "Bitstream Charter";
@@ -59,8 +59,8 @@
    fontAttrs.style = FONT_STYLE_NORMAL;
    styleAttrs.font = Font::create (layout, &fontAttrs);
 
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xa0a0a0);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xa0a0a0);
    styleAttrs.hBorderSpacing = 5;
    styleAttrs.vBorderSpacing = 5;
 
--- a/test/dw_ui_test.cc	Thu Dec 11 21:57:44 2008 +0100
+++ b/test/dw_ui_test.cc	Thu Dec 11 23:31:03 2008 +0100
@@ -53,8 +53,8 @@
    StyleAttrs styleAttrs;
    styleAttrs.initValues ();
    styleAttrs.margin.setVal (5);
-   styleAttrs.color = Color::createSimple (layout, 0x000000);
-   styleAttrs.backgroundColor = Color::createSimple (layout, 0xffffff);
+   styleAttrs.color = Color::create (layout, 0x000000);
+   styleAttrs.backgroundColor = Color::create (layout, 0xffffff);
 
    FontAttrs fontAttrs;
    fontAttrs.name = "Helvetica";