X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3130a8d0147094b618e6cfe4b3f62dacdbbea340..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/colourcmn.cpp?ds=sidebyside diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 7bbb17260f..70e4a1d9ca 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -177,13 +177,13 @@ bool wxColourBase::FromString(const wxString& str) // because this place can be called from constructor // and 'this' could not be available yet wxColour clr = wxTheColourDatabase->Find(str); - if (clr.Ok()) + if (clr.IsOk()) Set((unsigned char)clr.Red(), (unsigned char)clr.Green(), (unsigned char)clr.Blue()); } - if (Ok()) + if (IsOk()) return true; wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str); @@ -273,6 +273,16 @@ void wxColourBase::MakeDisabled(unsigned char* r, unsigned char* g, unsigned cha *b = AlphaBlend(*b, brightness, 0.4); } +wxColour& wxColourBase::MakeDisabled(unsigned char brightness) +{ + unsigned char r = Red(), + g = Green(), + b = Blue(); + MakeDisabled(&r, &g, &b, brightness); + Set(r, g, b, Alpha()); + return static_cast(*this); +} + // AlphaBlend is used by ChangeLightness and MakeDisabled // static