<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;The method create is a color factory depending on the parameter  used. The parameter varies between 0 and 1, if value is greater that 1, it will be divided by 100.0 .  The class Color Options :color is normally used in passing parameters in the construction of objects via facade method.&lt;/p&gt;
&lt;h2&gt;Creating &lt;span class=&quot;caps&quot;&gt;RGB&lt;/span&gt; color&lt;/h2&gt;
&lt;p&gt;String &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; color converter &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create '#FFAA33'
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Using Symbol class, the create method will be found in RGhost::Constants::Color::&lt;span class=&quot;caps&quot;&gt;RGB&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create :red
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Using Array with 3 elements&lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt; 
 Color.create [0.5, 0.3, 0.5]
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Hash with 3 pairs of key/value. Valid keys :red, :green and :blue &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create :red =&amp;gt; 0.5, :green =&amp;gt; 0.3, :blue =&amp;gt; 0.5
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Hash with 3 pairs of key/value. Valid keys :r, :g and :b &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create :r =&amp;gt; 0.5, :g =&amp;gt; 0.3, :b =&amp;gt; 0.5
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
h2. Creating &lt;span class=&quot;caps&quot;&gt;CMYK&lt;/span&gt; color&lt;/p&gt;
&lt;p&gt;Hash with 4 pair of key/value. Valids keys :cyan, :magenta, :yellow and :black &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create :cyan=&amp;gt; 1 ,:magenta =&amp;gt; 0.3, :yellow =&amp;gt; 0, :black =&amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Hash with 4 pair of key/value. Valids keys :c, :m, :y and :b &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create :c=&amp;gt; 1 ,:m =&amp;gt; 0.3, :y =&amp;gt; 0, :b =&amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;h2&gt;Creating Gray color&lt;/h2&gt;
&lt;p&gt;A single Numeric &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create 0.5
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
50 percent of black will be divided by 100.0 &lt;br /&gt;
&lt;pre&gt;&lt;code class='ruby'&gt;
 Color.create 50
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-25T08:34:48-08:00</created-at>
  <id type="integer">102992</id>
  <permalink>color-rgb-cmyk-and-grayscale</permalink>
  <repository-id type="integer">89573</repository-id>
  <title>Color RGB CMYK and Grayscale</title>
  <updated-at type="datetime">2009-08-03T04:42:32-07:00</updated-at>
  <user-id type="integer">22649</user-id>
</wiki>
