Смотри пример:
Код функции:
function generateColors(step, min_color, max_color) {
var R_step = min_color;
var G_step = min_color;
var B_step = min_color;
var color_list = [];
var somecolor;
while (R_step <= max_color) {
G_step = min_color;
while (G_step <= max_color) {
B_step = min_color;
while (B_step <= max_color) {
somecolor = R_step + G_step*256 + B_step*256*256;
color_list.push('#'+somecolor.toString(16));
B_step += step;
}
G_step += step;
}
R_step += step;
}
return color_list;
}
Применение:
cl = generateColors(70, 30, 200);