System Color for Panel Background

What's the correct sys color index to use to retrieve the background
color of a Panel?

The background: I have an HtmlWindow that I need to have the save
background color as the panel that contains it.

I'm using color..GetAsString(wx.C2S_HTML_SYNTAX) to get the hex coded
version of the color.

The obvious solution would be to use GetBackgroundColour on the
containing panel and use that but it returns the wrong color on both Mac
and Linux. That's from comparing a screen shot with the value returned.

I've enumerated through all of the sys colors and I found one index that
matches on Linux, INFOBK I believe, but none of them match on the Mac.

Here is what a screenshot shows to be the true color on the Mac:
(232, 232, 232)

and below is what the sys colors are returned as on the Mac

[('SYS_COLOUR_3DDKSHADOW', wx.Colour(68, 68, 68, 255)),
('SYS_COLOUR_3DFACE', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_3DHIGHLIGHT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_3DHILIGHT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_3DLIGHT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_3DSHADOW', wx.Colour(190, 190, 190, 255)),
('SYS_COLOUR_ACTIVEBORDER', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_ACTIVECAPTION', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_APPWORKSPACE', wx.Colour(128, 128, 128, 255)),
('SYS_COLOUR_BACKGROUND', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_BTNFACE', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_BTNHIGHLIGHT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_BTNHILIGHT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_BTNSHADOW', wx.Colour(190, 190, 190, 255)),
('SYS_COLOUR_BTNTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_CAPTIONTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_DESKTOP', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_GRADIENTACTIVECAPTION', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_GRADIENTINACTIVECAPTION', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_GRAYTEXT', wx.Colour(204, 204, 204, 255)),
('SYS_COLOUR_HIGHLIGHT', wx.Colour(181, 213, 255, 255)),
('SYS_COLOUR_HIGHLIGHTTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_HOTLIGHT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_INACTIVEBORDER', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_INACTIVECAPTION', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_INACTIVECAPTIONTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_INFOBK', wx.Colour(255, 255, 255, 255)),
('SYS_COLOUR_INFOTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_LISTBOX', wx.Colour(255, 255, 255, 255)),
('SYS_COLOUR_MAX', wx.Colour(255, 255, 255, 255)),
('SYS_COLOUR_MENU', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_MENUBAR', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_MENUHILIGHT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_MENUTEXT', wx.Colour(0, 0, 0, 255)),
('SYS_COLOUR_SCROLLBAR', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_WINDOW', wx.Colour(255, 255, 255, 255)),
('SYS_COLOUR_WINDOWFRAME', wx.Colour(221, 221, 221, 255)),
('SYS_COLOUR_WINDOWTEXT', wx.Colour(0, 0, 0, 255))]

···

--

Bobby R. Ward
------------------------
bobbyrward@gmail.com

>
> The background: I have an HtmlWindow that I need to have the save
> background color as the panel that contains it.
>
> I'm using color..GetAsString(wx.C2S_HTML_SYNTAX) to get the hex coded
> version of the color.
>
> The obvious solution would be to use GetBackgroundColour on the
> containing panel and use that but it returns the wrong color on both Mac
> and Linux. That's from comparing a screen shot with the value returned.

Try this instead: Don't set a color in the HTML tags, and then set the
bg color of the HtmlWindow to wx.NullColour.

Thank you. That works great as long as you reset it after every call to
SetPage.

···

--
Bobby R. Ward
--------------------
bobbyrward@gmail.com

"There is no such thing as "herring" in MY dictionary."
-- Dirk Gently