1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
<HTML>
<head><title>wxColour</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxcolour"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx45.htm#wxcloseevent"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx47.htm#wxcolourdata"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxColour</H2>
<P>
A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
and is used to determine drawing colours. See the
entry for <A HREF="wx48.htm#wxcolourdatabase">wxColourDatabase</A> for how a pointer to a predefined,
named colour may be returned instead of creating a new colour.<P>
Valid RGB values are in the range 0 to 255.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/colour.h><P>
<B><FONT COLOR="#FF0000">Predefined objects</FONT></B><P>
Objects:<P>
<B>wxNullColour</B><P>
Pointers:<P>
<B>wxBLACK<BR>
wxWHITE<BR>
wxRED<BR>
wxBLUE<BR>
wxGREEN<BR>
wxCYAN<BR>
wxLIGHT_GREY</B><P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx48.htm#wxcolourdatabase">wxColourDatabase</A>, <A HREF="wx169.htm#wxpen">wxPen</A>, <A HREF="wx36.htm#wxbrush">wxBrush</A>,
<A HREF="wx49.htm#wxcolourdialog">wxColourDialog</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxcolourconstr">wxColour::wxColour</A><BR>
<A HREF="#wxcolourblue">wxColour::Blue</A><BR>
<A HREF="#wxcolourgetpixel">wxColour::GetPixel</A><BR>
<A HREF="#wxcolourgreen">wxColour::Green</A><BR>
<A HREF="#wxcolourok">wxColour::Ok</A><BR>
<A HREF="#wxcolourred">wxColour::Red</A><BR>
<A HREF="#wxcolourset">wxColour::Set</A><BR>
<A HREF="#wxcolourassign">wxColour::operator =</A><BR>
<A HREF="#wxcolourequality">wxColour::operator ==</A><BR>
<A HREF="#wxcolourinequality">wxColour::operator !=</A><BR>
<P>
<HR>
<A NAME="wxcolourconstr"></A>
<H3>wxColour::wxColour</H3>
<P>
<B></B> <B>wxColour</B>()<P>
Default constructor.<P>
<B></B> <B>wxColour</B>(<B>const unsigned char</B><I> red</I>, <B>const unsigned char</B><I> green</I>, <B>const unsigned char</B><I> blue</I>)<P>
Constructs a colour from red, green and blue values.<P>
<B></B> <B>wxColour</B>(<B>const wxString& </B><I>colourNname</I>)<P>
Constructs a colour object using a colour name
listed in <B>wxTheColourDatabase</B>.<P>
<B></B> <B>wxColour</B>(<B>const wxColour&</B><I> colour</I>)<P>
Copy constructor.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>red</I><UL><UL>
The red value.</UL></UL>
<P>
<I>green</I><UL><UL>
The green value.</UL></UL>
<P>
<I>blue</I><UL><UL>
The blue value.</UL></UL>
<P>
<I>colourName</I><UL><UL>
The colour name.</UL></UL>
<P>
<I>colour</I><UL><UL>
The colour to copy.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx48.htm#wxcolourdatabase">wxColourDatabase</A><P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
Constructors supported by wxPython are:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>wxColour(red=0, green=0, blue=0)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxNamedColour(name)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxcolourblue"></A>
<H3>wxColour::Blue</H3>
<P>
<B>unsigned char</B> <B>Blue</B>() <B>const</B><P>
Returns the blue intensity.<P>
<HR>
<A NAME="wxcolourgetpixel"></A>
<H3>wxColour::GetPixel</H3>
<P>
<B>long</B> <B>GetPixel</B>() <B>const</B><P>
Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
On X, an allocated pixel value is returned.<P>
-1 is returned if the pixel is invalid (on X, unallocated).<P>
<HR>
<A NAME="wxcolourgreen"></A>
<H3>wxColour::Green</H3>
<P>
<B>unsigned char</B> <B>Green</B>() <B>const</B><P>
Returns the green intensity.<P>
<HR>
<A NAME="wxcolourok"></A>
<H3>wxColour::Ok</H3>
<P>
<B>bool</B> <B>Ok</B>() <B>const</B><P>
Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).<P>
<HR>
<A NAME="wxcolourred"></A>
<H3>wxColour::Red</H3>
<P>
<B>unsigned char</B> <B>Red</B>() <B>const</B><P>
Returns the red intensity.<P>
<HR>
<A NAME="wxcolourset"></A>
<H3>wxColour::Set</H3>
<P>
<B>void</B> <B>Set</B>(<B>const unsigned char</B><I> red</I>, <B>const unsigned char</B><I> green</I>, <B>const unsigned char</B><I> blue</I>)<P>
Sets the RGB intensity values.<P>
<HR>
<A NAME="wxcolourassign"></A>
<H3>wxColour::operator =</H3>
<P>
<B>wxColour&</B> <B>operator =</B>(<B>const wxColour&</B><I> colour</I>)<P>
Assignment operator, taking another colour object.<P>
<B>wxColour&</B> <B>operator =</B>(<B>const wxString&</B><I> colourName</I>)<P>
Assignment operator, using a colour name to be found in the colour database.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx48.htm#wxcolourdatabase">wxColourDatabase</A><P>
<HR>
<A NAME="wxcolourequality"></A>
<H3>wxColour::operator ==</H3>
<P>
<B>bool</B> <B>operator ==</B>(<B>const wxColour&</B><I> colour</I>)<P>
Tests the equality of two colours by comparing individual red, green blue colours.<P>
<HR>
<A NAME="wxcolourinequality"></A>
<H3>wxColour::operator !=</H3>
<P>
<B>bool</B> <B>operator !=</B>(<B>const wxColour&</B><I> colour</I>)<P>
Tests the inequality of two colours by comparing individual red, green blue colours.<P>
</BODY></HTML>
|