/[colormatch]/trunk/index.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by dpavlin, Sat Oct 2 23:24:01 2004 UTC revision 2 by dpavlin, Sat Oct 2 23:25:50 2004 UTC
# Line 201  width: 760px; Line 201  width: 760px;
201  </head>  </head>
202  <body>  <body>
203  <div id="sitewidth">  <div id="sitewidth">
204  <div id="news">  <div id="news" style="display: none;">
205          <h1>ColorMatch Remix</h1>          <h1>ColorMatch Remix</h1>
206          <p>This colorpicker is based heavily upon the code from <a href="http://colormatch.dk">ColorMatch 5k</a>. I've made it more compatible - it now works in Mozilla, and should also work in Opera, since I'm using a much better slider control. I've also added 3 more colors, bringing the total auto-generated colors to 9, and the ability to export your colors to a Photoshop color table.</p>          <p>This colorpicker is based heavily upon the code from <a href="http://colormatch.dk">ColorMatch 5k</a>. I've made it more compatible - it now works in Mozilla, and should also work in Opera, since I'm using a much better slider control. I've also added 3 more colors, bringing the total auto-generated colors to 9, and the ability to export your colors to a Photoshop color table.</p>
207          <p>You can also download the full source code <a href="colormatch.zip" title="Source Code">here.</a></p>          <p>You can also download the full source code <a href="colormatch.zip" title="Source Code">here.</a></p>
# Line 214  width: 760px; Line 214  width: 760px;
214                  <li>Jan. 19, 2004: I've <a href="colormatch.zip" title="Everything you need.">zipped up</a> all the code, along with a dump of the database, for those of you who'd like to run it on your own server. All I request is that you link back to my main page.</li>                  <li>Jan. 19, 2004: I've <a href="colormatch.zip" title="Everything you need.">zipped up</a> all the code, along with a dump of the database, for those of you who'd like to run it on your own server. All I request is that you link back to my main page.</li>
215                  <li>Dec. 06, 2003: This site featured in Lockergnome's <a href="http://channels.lockergnome.com/windows/backissues/20031205.phtml">Windows Fanatics</a> newsletter! (Thanks for the link, Chris!) </li>                  <li>Dec. 06, 2003: This site featured in Lockergnome's <a href="http://channels.lockergnome.com/windows/backissues/20031205.phtml">Windows Fanatics</a> newsletter! (Thanks for the link, Chris!) </li>
216          </ul>          </ul>
         <form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">  
                 <p>  
                         <input type="hidden" name="cmd" value="_xclick" />  
                         <input type="hidden" name="business" value="twyst@twysted.net" />  
                         <input type="hidden" name="no_note" value="1" />  
                         <input type="hidden" name="currency_code" value="USD" />  
                         <input type="hidden" name="tax" value="0" />  
                         <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />  
                 </p>  
         </form>  
217  </div>  </div>
218  <div id="allsliders">  <div id="allsliders">
219          <div class="spacer"></div>          <div class="spacer"></div>
# Line 253  width: 760px; Line 243  width: 760px;
243                  </div>                  </div>
244          </div>          </div>
245          <div id="slideright">          <div id="slideright">
246                  <div id="color-result"></div>                  <div id="color-result">
247                    <div style="float: left; width: 49%; text-align: center;" id="light" onClick="c2r('light');">
248                    light
249                    </div>
250                    <div style="float: right; width: 49%; text-align: center;" id="dark" onClick="c2r('dark');">
251                    dark
252                    </div>
253                    </div>
254          </div>          </div>
255          <div class="spacer"></div>          <div class="spacer"></div>
256  </div>  </div>
# Line 302  width: 760px; Line 299  width: 760px;
299                          <select id="coltheme" name="coltheme" onchange="load_theme();">                          <select id="coltheme" name="coltheme" onchange="load_theme();">
300          <?          <?
301                  include("config.php");                  include("config.php");
302                  $db = mysql_connect($dbhost,$dbuser,$dbpass);                  $db = pg_connect($pg);
                 mysql_select_db($dbtable);  
303                  $rgb = "$red,$green,$blue";                  $rgb = "$red,$green,$blue";
304                  $r = mysql_query("Select basecol,name from colorpick where approved='1' order by name");                  $r = pg_query("select basecol,name from colorpick where approved='1' order by name");
305                  while ($q = mysql_fetch_assoc($r)) {                  while ($q = pg_fetch_assoc($r)) {
306                          if($q["basecol"] == $rgb) {                          if($q["basecol"] == $rgb) {
307                                  $sel = "selected=\"selected\" ";                                  $sel = "selected=\"selected\" ";
308                          } else {                          } else {
# Line 405  function fixSize() { Line 401  function fixSize() {
401          b.recalculate();          b.recalculate();
402  }  }
403    
404    var step = 8;
405    
406    function inc(n) {
407            if (n + step < 255) {
408                    n += step;
409            } else {
410                    n = 255;
411            }
412            return n;
413    }
414    
415    function dec(n) {
416            if (n - step > 0) {
417                    n -= step;
418            } else {
419                    n = 0;
420            }
421            return n;
422    }
423    
424    function light() {
425            r.setValue( inc( r.getValue() ) );
426            g.setValue( inc( g.getValue() ) );
427            b.setValue( inc( b.getValue() ) );
428    }
429    
430    function dark() {
431            r.setValue( dec( r.getValue() ) );
432            g.setValue( dec( g.getValue() ) );
433            b.setValue( dec( b.getValue() ) );
434    }
435    
436    
437  window.onresize = fixSize;  window.onresize = fixSize;
438    
439  fixSize();  fixSize();

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.26