]> git.saurik.com Git - wxWidgets.git/commitdiff
wxColour -> NSColor conversion.
authorKevin Ollivier <kevino@theolliviers.com>
Sun, 1 Nov 2009 00:56:23 +0000 (00:56 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sun, 1 Nov 2009 00:56:23 +0000 (00:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/core/colour.h
src/osx/cocoa/colour.mm

index 388b176f2a70b7b7bc9b9658e2194cf83527e71e..bbc72012221ed50a852b686d29fbad63ce9c87b2 100644 (file)
@@ -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);
index ffce54a7943ab690ec7f7ad189069f2c175470ff..aebe52e1f35654e2850b98d393121685d24691a1 100644 (file)
@@ -33,4 +33,9 @@ wxColour::wxColour(WX_NSColor col)
     }
     InitFromComponents(const_cast<const CGFloat*>(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