X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b534968dc31dc9a25aff117ba220be1378e50722..a75124d0da255513e83d2e62f963dd849829466b:/src/common/colourcmn.cpp 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); +} + +