- m_refData = new wxColourRefData;
- M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
- M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
- M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
- M_COLDATA->m_color.pixel = 0;
-}
-
-/* static */
-wxColour wxColour::CreateByName(const wxString& name)
-{
- wxColour col;
-
- GdkColor colGDK;
- if ( gdk_color_parse( wxGTK_CONV_SYS( name ), &colGDK ) )
- {
- wxColourRefData *refData = new wxColourRefData;
- refData->m_color = colGDK;
- col.m_refData = refData;
- }
-
- return col;
-}
-
-
-void wxColour::InitFromName( const wxString &colourName )
-{
- // check the cache first
- if ( wxTheColourDatabase )
- {
- *this = wxTheColourDatabase->Find(colourName);
- }
-
- if ( !Ok() )
- {
- *this = CreateByName(colourName);
- }
-
- if ( !Ok() )
- {
- wxFAIL_MSG( wxT("wxColour: couldn't find colour") );
- }