From 6bdcf0b14376e887647691552375ba4396c45b79 Mon Sep 17 00:00:00 2001
From: =?utf8?q?W=C5=82odzimierz=20Skiba?= <abx@abx.art.pl>
Date: Fri, 16 Jun 2006 10:42:07 +0000
Subject: [PATCH] Final fix from '[ 1473731 ] wxColourBase and wxString <->
 wxColour implementation'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 samples/htlbox/htlbox.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp
index 0522932c5e..a5a87d3431 100644
--- a/samples/htlbox/htlbox.cpp
+++ b/samples/htlbox/htlbox.cpp
@@ -475,13 +475,16 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const
     return s;
 #else
     int level = n % 6 + 1;
-    wxString label = wxString::Format(_T("<h%d><font color=#%2x%2x%2x>")
+
+    wxColour clr(abs((int)n - 192) % 256,
+                 abs((int)n - 256) % 256,
+                 abs((int)n - 128) % 256);
+
+    wxString label = wxString::Format(_T("<h%d><font color=%s>")
                                       _T("Item</font> <b>%lu</b>")
                                       _T("</h%d>"),
                                       level,
-                                      abs((int)n - 192) % 256,
-                                      abs((int)n - 256) % 256,
-                                      abs((int)n - 128) % 256,
+                                      clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
                                       (unsigned long)n, level);
     if ( n == 1 )
     {
-- 
2.47.2