-wxColour& wxColour::operator = ( const wxString& colourName )
-{
- UnRef();
- wxNode *node = (wxNode *) NULL;
- if ((wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
- {
- wxColour *col = (wxColour*)node->Data();
- if (col) Ref( *col );
- }
- else
- {
- m_refData = new wxColourRefData();
- if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
- {
- wxFAIL_MSG( "wxColour: couldn't find colour" );
- delete m_refData;
- m_refData = (wxObjectRefData *) NULL;
- }
- }
- return *this;
+ m_refData = new wxColourRefData(
+ (guint16(red) << SHIFT) + red,
+ (guint16(green) << SHIFT) + green,
+ (guint16(blue) << SHIFT) + blue,
+ (guint16(alpha) << SHIFT) + alpha);