全てのしおりの色をグラデーションにする

説明

全てのしおりの色をグラデーションにするには、1をしおりの総数で除算します。その値をしおりの順番に乗算しcolorプロパティにカラー配列を設定します。

サンプル [実行する]

bObj = bookmarkRoot.children;
stp = 1;
if (bObj.length > 0) stp = 1 / bObj.length;
for (i=0; i<bObj.length; i++)
{
bObj[i].color = ["RGB",i*stp,i*stp,0];
}