3
Answers

Getting a Color Value from a ComboBox

Hi everyone, i do have a problem since last night. I am trying to pass a value from a combobox which contains some color values like "BLUE", "CYAN", "RED" and so on. I hope you don't mind if i will try to paste some code here as this is a third party product hoping you can help me out of here.<br /> <br /><div> I have an object SOLIDBRUSH which accepts a color parameter like </div><div>&nbsp;</div><div><strong style="color: #ff0000;">&nbsp;<code>SolidBrush(Color.Aqua)</code> </strong></div><div>&nbsp;</div><div>so.<br /> So what i am trying to do now is to pass my combobox value like this</div><div>&nbsp;</div><div><strong><code style="color: #ff0000;">SolidBrush(combobox1.selectedItem)</code>&nbsp;</strong></div><div>&nbsp;</div><div>&nbsp;</div><div>To better understand my situation, let me post what the SolidBrush class contains, and what the Color class contains as well<br /> <br /> SOLIDBRUSH CLASS</div><div>&nbsp;</div><div><div class="dp-highlighter"><ol class="dp-c" start="1"><li class="alt"><span><span class="keyword">using</span><span>&nbsp;System;&nbsp;&nbsp;</span></span></li><li class=""><span>06&nbsp;&nbsp;<span class="keyword">using</span><span>&nbsp;WebSupergoo.ABCpdf10.Drawing;&nbsp;&nbsp;</span></span></li><li class="alt"><span>07&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>08&nbsp;&nbsp;<span class="keyword">namespace</span><span>&nbsp;WebSupergoo.ABCpdf10.Drawing&nbsp;&nbsp;</span></span></li><li class="alt"><span>09&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">interface</span><span>&nbsp;Brush&nbsp;&nbsp;</span></span></li><li class="alt"><span>11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;Color&nbsp;{&nbsp;<span class="keyword">get</span><span>;&nbsp;</span><span class="keyword">set</span><span>;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;SolidBrush&nbsp;&nbsp;</span></li><li class=""><span>18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Used&nbsp;to&nbsp;fill&nbsp;the&nbsp;interiors&nbsp;of&nbsp;graphical&nbsp;shapes&nbsp;such&nbsp;as&nbsp;rectangles,&nbsp;ellipses,&nbsp;pies,&nbsp;polygons,&nbsp;and&nbsp;paths.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">sealed</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;SolidBrush&nbsp;:&nbsp;Brush&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Declare&nbsp;variables&nbsp;&nbsp;</span></li><li class="alt"><span>23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;_color;&nbsp;&nbsp;</span></li><li class=""><span>24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#endregion&nbsp;&nbsp;</span></li><li class=""><span>26&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>27&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Properties&nbsp;&nbsp;</span></li><li class=""><span>28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>29&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;color&nbsp;of&nbsp;this&nbsp;Brush&nbsp;object.&nbsp;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>31&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;Color&nbsp;Color&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;_color;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;_color&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>35&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#endregion&nbsp;&nbsp;</span></li><li class=""><span>36&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Constructors&nbsp;&nbsp;</span></li><li class=""><span>38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Initializes&nbsp;a&nbsp;new&nbsp;instance&nbsp;of&nbsp;the&nbsp;Brush&nbsp;class&nbsp;with</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;the&nbsp;specified&nbsp;Color&nbsp;property.</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>41&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>42&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="color"&gt;The&nbsp;color&nbsp;of&nbsp;this&nbsp;System.Drawing.Pen&nbsp;object.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>43&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;SolidBrush(Color&nbsp;color)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>44&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_color&nbsp;=&nbsp;color;&nbsp;&nbsp;</span></li><li class="alt"><span>45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#endregion&nbsp;&nbsp;</span></li><li class=""><span>48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>49&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">override</span><span>&nbsp;</span><span class="keyword">bool</span><span>&nbsp;Equals(</span><span class="keyword">object</span><span>&nbsp;obj)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Brush&nbsp;b&nbsp;=&nbsp;obj&nbsp;<span class="keyword">as</span><span>&nbsp;Brush;&nbsp;&nbsp;</span></span></li><li class="alt"><span>51&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(b&nbsp;!=&nbsp;</span><span class="keyword">null</span><span>)&nbsp;&nbsp;</span></span></li><li class=""><span>52&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;b.Color.Equals(Color);&nbsp;&nbsp;</span></span></li><li class="alt"><span>53&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>54&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;</span><span class="keyword">false</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>55&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>56&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>57&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">override</span><span>&nbsp;</span><span class="keyword">int</span><span>&nbsp;GetHashCode()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>58&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;</span><span class="keyword">base</span><span>.GetHashCode&nbsp;();&nbsp;&nbsp;</span></span></li><li class="alt"><span>59&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>61&nbsp;&nbsp;#endregion&nbsp;&nbsp; <br /></span></li></ol></div>&nbsp;COLOR CLASS</div><div><div class="dp-highlighter"><ol class="dp-c" start="1"><li class="alt"><span><span class="keyword">using</span><span>&nbsp;System;&nbsp;&nbsp;</span></span></li><li class=""><span>006&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>007&nbsp;<span class="keyword">namespace</span><span>&nbsp;WebSupergoo.ABCpdf10.Drawing&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Color&nbsp;&nbsp;</span></li><li class="alt"><span>009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;A&nbsp;color&nbsp;in&nbsp;RGB,&nbsp;CMYK&nbsp;or&nbsp;Grayscale.</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;Color&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Declare&nbsp;variables&nbsp;&nbsp;</span></li><li class=""><span>014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;a&nbsp;=&nbsp;1;&nbsp;&nbsp;</span></span></li><li class="alt"><span>015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;r&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class=""><span>016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;g&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class="alt"><span>017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;b&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class=""><span>018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;c&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class="alt"><span>019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;m&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class=""><span>020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;y&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class="alt"><span>021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;k&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class=""><span>022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">internal</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;gray&nbsp;=&nbsp;0;&nbsp;&nbsp;</span></span></li><li class="alt"><span>023&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#endregion&nbsp;&nbsp;</span></li><li class=""><span>024&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Properties&nbsp;&nbsp;</span></li><li class=""><span>026&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;alpha&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;A&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;a;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;a&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;red&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;R&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;r;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;r&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>041&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;green&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;G&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;g;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;g&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>049&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;blue&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;B&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;b;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;b&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>057&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;cyan&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;C&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;c;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;c&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>065&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;magenta&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;M&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;m;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;m&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>073&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;yellow&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;Y&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;y;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;y&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>081&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;black&nbsp;component.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;K&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;k;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;k&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>089&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;gray&nbsp;level.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">double</span><span>&nbsp;GrayScale&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;gray;&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">set</span><span>&nbsp;{&nbsp;gray&nbsp;=&nbsp;value;&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#endregion&nbsp;&nbsp;</span></li><li class=""><span>098&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">override</span><span>&nbsp;</span><span class="keyword">bool</span><span>&nbsp;Equals(</span><span class="keyword">object</span><span>&nbsp;obj)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;c&nbsp;=&nbsp;obj&nbsp;<span class="keyword">as</span><span>&nbsp;Color;&nbsp;&nbsp;</span></span></li><li class="alt"><span>101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(c&nbsp;!=&nbsp;</span><span class="keyword">null</span><span>)&nbsp;&nbsp;</span></span></li><li class=""><span>102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;(A&nbsp;==&nbsp;c.A)&nbsp;&amp;&amp;&nbsp;(R&nbsp;==&nbsp;c.R)&nbsp;&amp;&amp;&nbsp;(G&nbsp;==&nbsp;c.G)&nbsp;&amp;&amp;&nbsp;(B&nbsp;==&nbsp;c.B)/&gt;/&gt;;&nbsp;&nbsp;</span></span></li><li class="alt"><span>103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;</span><span class="keyword">false</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>106&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">override</span><span>&nbsp;</span><span class="keyword">int</span><span>&nbsp;GetHashCode()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;</span><span class="keyword">base</span><span>.GetHashCode&nbsp;();&nbsp;&nbsp;</span></span></li><li class="alt"><span>109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>110&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#region&nbsp;Static&nbsp;methods&nbsp;&nbsp;</span></li><li class=""><span>112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;8-bit&nbsp;color&nbsp;values</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;(red,&nbsp;green,&nbsp;and&nbsp;blue).&nbsp;The&nbsp;alpha&nbsp;value&nbsp;is&nbsp;implicitly&nbsp;255&nbsp;(fully&nbsp;opaque).</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="red"&gt;The&nbsp;red&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="green"&gt;The&nbsp;green&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="blue"&gt;The&nbsp;blue&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromArgb(</span><span class="keyword">int</span><span>&nbsp;red,&nbsp;</span><span class="keyword">int</span><span>&nbsp;green,&nbsp;</span><span class="keyword">int</span><span>&nbsp;blue)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;FromArgb(255,&nbsp;red,&nbsp;green,&nbsp;blue);&nbsp;&nbsp;</span></span></li><li class=""><span>122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>123&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>124&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>125&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;a&nbsp;32-bit&nbsp;ARGB&nbsp;value.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="argb"&gt;A&nbsp;value&nbsp;specifying&nbsp;the&nbsp;32-bit&nbsp;ARGB&nbsp;value.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromArgb(</span><span class="keyword">int</span><span>&nbsp;argb)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Drawing.Color&nbsp;clr&nbsp;=&nbsp;System.Drawing.Color.FromArgb(argb);&nbsp;&nbsp;</span></li><li class="alt"><span>133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;FromArgb(clr.A,&nbsp;clr.R,&nbsp;clr.G,&nbsp;clr.B)/&gt;/&gt;;&nbsp;&nbsp;</span></span></li><li class=""><span>134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>135&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>137&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;pre-defined&nbsp;color.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="color"&gt;An&nbsp;element&nbsp;of&nbsp;the&nbsp;System.Drawing.KnownColor&nbsp;enumeration.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromKnownColor(System.Drawing.KnownColor&nbsp;color)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Drawing.Color&nbsp;sysColor&nbsp;=&nbsp;System.Drawing.Color.FromKnownColor(color);&nbsp;&nbsp;</span></li><li class="alt"><span>145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;FromArgb(sysColor.A,&nbsp;sysColor.R,&nbsp;sysColor.G,&nbsp;sysColor.B)/&gt;/&gt;;&nbsp;&nbsp;</span></span></li><li class=""><span>146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>147&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;System.Drawing.Color&nbsp;structure,</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;but&nbsp;with&nbsp;the&nbsp;new&nbsp;specified&nbsp;alpha&nbsp;value.</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="alpha"&gt;The&nbsp;alpha&nbsp;value&nbsp;for&nbsp;the&nbsp;new&nbsp;System.Drawing.Color&nbsp;structure.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="baseColor"&gt;The&nbsp;System.Drawing.Color&nbsp;structure&nbsp;from&nbsp;which&nbsp;to&nbsp;create&nbsp;the&nbsp;new&nbsp;System.Drawing.Color&nbsp;structure.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromArgb(</span><span class="keyword">int</span><span>&nbsp;alpha,&nbsp;System.Drawing.Color&nbsp;baseColor)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;FromArgb(alpha,&nbsp;baseColor.R,&nbsp;baseColor.G,&nbsp;baseColor.B)/&gt;/&gt;;&nbsp;&nbsp;</span></span></li><li class="alt"><span>157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;8-bit&nbsp;RGB&nbsp;color&nbsp;values</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;(alpha,&nbsp;red,&nbsp;green,&nbsp;and&nbsp;blue).</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="alpha"&gt;The&nbsp;alpha&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="red"&gt;The&nbsp;red&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="green"&gt;The&nbsp;green&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="blue"&gt;The&nbsp;blue&nbsp;component&nbsp;value.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;255.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromArgb(</span><span class="keyword">int</span><span>&nbsp;alpha,&nbsp;</span><span class="keyword">int</span><span>&nbsp;red,&nbsp;</span><span class="keyword">int</span><span>&nbsp;green,&nbsp;</span><span class="keyword">int</span><span>&nbsp;blue)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;clr&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;Color();&nbsp;&nbsp;</span></span></li><li class=""><span>170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.a&nbsp;=&nbsp;alpha&nbsp;/&nbsp;255F;&nbsp;&nbsp;</span></li><li class="alt"><span>171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.r&nbsp;=&nbsp;red&nbsp;/&nbsp;255F;&nbsp;&nbsp;</span></li><li class=""><span>172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.g&nbsp;=&nbsp;green&nbsp;/&nbsp;255F;&nbsp;&nbsp;</span></li><li class="alt"><span>173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.b&nbsp;=&nbsp;blue&nbsp;/&nbsp;255F;&nbsp;&nbsp;</span></li><li class=""><span>174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;clr;&nbsp;&nbsp;</span></span></li><li class="alt"><span>175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>176&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>177&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>178&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;ARGB&nbsp;color&nbsp;values</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;(alpha,&nbsp;red,&nbsp;green,&nbsp;and&nbsp;blue).</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>180&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>181&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="cyan"&gt;The&nbsp;alpha&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>182&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="magenta"&gt;The&nbsp;red&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="yellow"&gt;The&nbsp;green&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>184&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="black"&gt;The&nbsp;blue&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>185&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>186&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromArgb(</span><span class="keyword">double</span><span>&nbsp;alpha,&nbsp;</span><span class="keyword">double</span><span>&nbsp;red,&nbsp;</span><span class="keyword">double</span><span>&nbsp;green,&nbsp;</span><span class="keyword">double</span><span>&nbsp;blue)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>187&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;clr&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;Color();&nbsp;&nbsp;</span></span></li><li class=""><span>188&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.a&nbsp;=&nbsp;alpha;&nbsp;&nbsp;</span></li><li class="alt"><span>189&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.r&nbsp;=&nbsp;red;&nbsp;&nbsp;</span></li><li class=""><span>190&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.g&nbsp;=&nbsp;green;&nbsp;&nbsp;</span></li><li class="alt"><span>191&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.b&nbsp;=&nbsp;blue;&nbsp;&nbsp;</span></li><li class=""><span>192&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;clr;&nbsp;&nbsp;</span></span></li><li class="alt"><span>193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>194&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>195&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>196&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;CMYK&nbsp;color&nbsp;values</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;(cyan,&nbsp;magenta,&nbsp;yellow,&nbsp;and&nbsp;black).</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>199&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="cyan"&gt;The&nbsp;cyan&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="magenta"&gt;The&nbsp;magenta&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="yellow"&gt;The&nbsp;yellow&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="black"&gt;The&nbsp;black&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>203&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>204&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromCmyk(</span><span class="keyword">double</span><span>&nbsp;cyan,&nbsp;</span><span class="keyword">double</span><span>&nbsp;magenta,&nbsp;</span><span class="keyword">double</span><span>&nbsp;yellow,&nbsp;</span><span class="keyword">double</span><span>&nbsp;black)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;clr&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;Color();&nbsp;&nbsp;</span></span></li><li class=""><span>206&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.c&nbsp;=&nbsp;cyan;&nbsp;&nbsp;</span></li><li class="alt"><span>207&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.m&nbsp;=&nbsp;magenta;&nbsp;&nbsp;</span></li><li class=""><span>208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.y&nbsp;=&nbsp;yellow;&nbsp;&nbsp;</span></li><li class="alt"><span>209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.k&nbsp;=&nbsp;black;&nbsp;&nbsp;</span></li><li class=""><span>210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;clr;&nbsp;&nbsp;</span></span></li><li class="alt"><span>211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>212&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Creates&nbsp;a&nbsp;Color&nbsp;from&nbsp;the&nbsp;specified&nbsp;gray&nbsp;level.</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>216&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;param&nbsp;name="gray"&gt;The&nbsp;gray&nbsp;component.&nbsp;Valid&nbsp;values&nbsp;are&nbsp;0&nbsp;through&nbsp;1.&lt;/param&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>217&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;returns&gt;The&nbsp;Color&nbsp;that&nbsp;this&nbsp;method&nbsp;creates.&lt;/returns&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>218&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;FromCmyk(</span><span class="keyword">double</span><span>&nbsp;gray)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;clr&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;Color();&nbsp;&nbsp;</span></span></li><li class=""><span>220&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clr.gray&nbsp;=&nbsp;gray;&nbsp;&nbsp;</span></li><li class="alt"><span>221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;clr;&nbsp;&nbsp;</span></span></li><li class=""><span>222&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>223&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>225&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;Gets&nbsp;a&nbsp;system&nbsp;defined&nbsp;color</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>226&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">///&nbsp;&lt;/summary&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>227&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;AliceBlue&nbsp;{&nbsp;</span><span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;FromKnownColor(System.Drawing.KnownColor.AliceBlue);&nbsp;}&nbsp;}&nbsp;&nbsp;</span></span></li><li class=""><span>228&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;Color&nbsp;Yellow&nbsp;{&nbsp;</span><span class="keyword">get</span><span>&nbsp;{&nbsp;</span><span class="keyword">return</span><span>&nbsp;FromKnownColor(System.Drawing.KnownColor.Yellow);&nbsp;}&nbsp;}&nbsp;&nbsp;</span></span></li><li class="alt"><span>229&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>230&nbsp;LIST&nbsp;of&nbsp;colors&nbsp;goes&nbsp;on..&nbsp; <br /></span></li></ol></div>&nbsp;</div><div>&nbsp;Thanks</div><div>&nbsp;</div>
Answers (3)