]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/colour.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKCOLOURH__
12 #define __GTKCOLOURH__
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/gdiobj.h"
22 #include "wx/palette.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 class wxColour
: public wxGDIObject
46 wxColour( unsigned char red
, unsigned char green
, unsigned char blue
);
47 wxColour( unsigned long colRGB
) { Set(colRGB
); }
49 // implicit conversion from the colour name
50 wxColour( const wxString
&colourName
) { InitFromName(colourName
); }
51 wxColour( const char *colourName
) { InitFromName(colourName
); }
53 // copy ctors and assignment operators
54 wxColour( const wxColour
& col
);
55 wxColour
& operator = ( const wxColour
& col
);
61 bool operator == ( const wxColour
& col
);
62 bool operator != ( const wxColour
& col
);
65 void Set( unsigned char red
, unsigned char green
, unsigned char blue
);
66 void Set( unsigned long colRGB
)
68 // we don't need to know sizeof(long) here because we assume that the three
69 // least significant bytes contain the R, G and B values
70 Set((unsigned char)colRGB
,
71 (unsigned char)(colRGB
>> 8),
72 (unsigned char)(colRGB
>> 16));
75 unsigned char Red() const;
76 unsigned char Green() const;
77 unsigned char Blue() const;
81 void CalcPixel( GdkColormap
*cmap
);
83 GdkColor
*GetColor() const;
87 void InitFromName(const wxString
& colourName
);
90 DECLARE_DYNAMIC_CLASS(wxColour
)
93 #endif // __GTKCOLOURH__