Named Colour regression from 3.2 (Issue #26782)

26 views
Skip to first unread message

Scott Talbert

unread,
Aug 4, 2026, 11:21:53 PM (5 days ago) Aug 4
to wx-...@googlegroups.com, Subscribed
swt2c created an issue (wxWidgets/wxWidgets#26782)

This example works in 3.2, but seems to no longer work in current master:

#include <wx/wx.h>

class MyFrame : public wxFrame
{
public:
    MyFrame() : wxFrame(nullptr, wxID_ANY, "Named Colour")
    {
        SetSize(wxSize(400, 300));

        wxPanel* mainPanel = new wxPanel(this, wxID_ANY);
        mainPanel->SetBackgroundColour(wxColour("Dark Red"));

        Layout();
    }
};

class MyApp : public wxApp
{
public:
    bool OnInit() override
    {
        MyFrame* frame = new MyFrame();
        frame->Show();
        return true;
    }
};

wxIMPLEMENT_APP(MyApp);

It seems that perhaps some of the named colours got lost in the refactoring that happened in src/common/gdicmn.cpp?

3.2:
Image: Image (view on web)

3.3:
Image: Image (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26782@github.com>

Scott Talbert

unread,
Aug 4, 2026, 11:36:26 PM (5 days ago) Aug 4
to wx-...@googlegroups.com, Subscribed
swt2c left a comment (wxWidgets/wxWidgets#26782)

This might be the culprit:
55be0ed

It seems that "DarkRed" without a space works. So previously these GTK functions accidentally made "Dark Red" work. Not sure this is worth addressing since this colour isn't really part of the wx API?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26782/5187234887@github.com>

VZ

unread,
Aug 5, 2026, 8:16:55 AM (5 days ago) Aug 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26782)

Thanks for noticing this, I didn't realize GTK functions accepted spaces and that we don't do it any longer.

I think the best thing to do would be to just strip all spaces from the string before trying to construct a colour from it. This could be too permissive but I see no real harm from letting someone create a colour called "R E D" and it would take care of using "dark", "light", "medium", "pale" and I don't know how many others as separate words.

Do you (or anybody else) see any problem with doing this?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26782/5191599005@github.com>

VZ

unread,
Aug 6, 2026, 4:30:01 PM (3 days ago) Aug 6
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26782)

For some reason, GitHub didn't link it here but I made #26795 fixing this.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26782/5208918793@github.com>

VZ

unread,
Aug 9, 2026, 1:37:16 PM (13 hours ago) Aug 9
to wx-...@googlegroups.com, Subscribed

Closed #26782 as completed via c95ec21.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/26782/issue_event/29188509863@github.com>

Reply all
Reply to author
Forward
0 new messages