16
May 08

jQuery.Colors

This plugin has been developed by me when I start to create this site, with a lot of colors manipulations
I decided to write a group of functions and after that I transform it to a plugin. So feel free to use it.
Download it here: jQuery.Colors (5.43 KB) - 265 hits

Usage example:

 Javascript |  copy code |? 
1
2
  var Light = $.color(235, 235, 235);
3
  var Dark = $.tocolor("#ffa500");
4
  var GradLinkNormal = $.colorgrad(Light, Dark, 10);
5

Will result in a array with ten diferent colors, like this:

code:
 HTML |  copy code |? 
01
02
<script language="JavaScript">
03
  var Light = $.color(235, 235, 235);
04
  var Dark = $.tocolor("#ffa500");
05
  var GradLinkNormal = $.colorgrad(Light, Dark, 10);
06
  for(i = 1; i <= 10; i++){
07
    document.write("<div style='background:" + 
08
      GradLinkNormal.grad(i).hexHTML() + ";width:100px;padding:3px 3px;'>" + 
09
      GradLinkNormal.grad(i).hexHTML() + "</div>");
10
  }
11
</script>
12

2 comments

  1. This is a fantastic tool, Gilberto! Thank you so much for sharing. The site looks great, by the way.

  2. Eye Calamba…. aye yuh have it man… I would like to see this work as on gradient text.

Leave a comment