From: Kevin Ollivier Date: Sun, 1 Nov 2009 00:56:23 +0000 (+0000) Subject: wxColour -> NSColor conversion. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/19b409860202ab9bdc27dab3d17f388c1a1d9717 wxColour -> NSColor conversion. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/core/colour.h b/include/wx/osx/core/colour.h index 388b176f2a..bbc7201222 100644 --- a/include/wx/osx/core/colour.h +++ b/include/wx/osx/core/colour.h @@ -60,6 +60,7 @@ public: #endif #if wxOSX_USE_COCOA wxColour(WX_NSColor color); + WX_NSColor OSXGetNSColor(); #endif wxColour& operator=(CGColorRef col); wxColour& operator=(const wxColour& col); diff --git a/src/osx/cocoa/colour.mm b/src/osx/cocoa/colour.mm index ffce54a794..aebe52e1f3 100644 --- a/src/osx/cocoa/colour.mm +++ b/src/osx/cocoa/colour.mm @@ -33,4 +33,9 @@ wxColour::wxColour(WX_NSColor col) } InitFromComponents(const_cast(components), noComp); } + +WX_NSColor wxColour::OSXGetNSColor() +{ + return [NSColor colorWithDeviceRed:m_red / 255.0 green:m_green / 255.0 blue:m_blue / 255.0 alpha:m_alpha / 255.0]; +} #endif \ No newline at end of file