I needed a plugin, that will create a list of colors. This colors should be calculated by using two given colors (start and end color) and a calculation method like “linear” or “trigonometrical”. So I have started to create a new jQuery plugin (yes, it makes fun), which could solve this. It extends jQuery with these functions:
- and other helper functions
I have also added a function to set the color at jQuery objects. You can call…[source:js]
$(‘#list1 li’).colorize(‘#ff1313’, ‘#00F400’, [1,1,1],”color”);
… to set the color attribute for all list elements in “#list1” to colors, starting with ‘#ff1313’, ending with ‘#00F400’ and using linear transformation.