X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b534968dc31dc9a25aff117ba220be1378e50722..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/common/colourcmn.cpp?ds=sidebyside diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 4868f808f2..99243dd383 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -163,3 +163,25 @@ void wxColourBase::InitFromName(const wxString& col) } #endif // WXWIN_COMPATIBILITY_2_6 + +// wxColour <-> wxString utilities, used by wxConfig +wxString wxToString(const wxColourBase& col) +{ + return col.IsOk() ? col.GetAsString(wxC2S_CSS_SYNTAX) + : wxString(); +} + +bool wxFromString(const wxString& str, wxColourBase *col) +{ + wxCHECK_MSG( col, false, _T("NULL output parameter") ); + + if ( str.empty() ) + { + *col = wxNullColour; + return true; + } + + return col->Set(str); +} + +