No random color

 From:  Michael Gibson
4517.11 In reply to 4517.9 
Hi Pilou,

> I suppose there is no problem to give a negative increment
> red - = 4 (if it's the syntax and take care of a last result less 0 :)

Hmmm, I don't think that script was expecting for the numbers to become negative. You may need to add in an additional Math.abs( ); call to take the absolute value for that case, something like:

script: /* Make gradient styles */ var red = 12, green = 15, blue = 20; for ( var i = 1; i <= 100; ++i ) { var style = moi.geometryDatabase.addStyle(); style.name = 'Gradient ' + i; style.color = (Math.abs(red%256)<<16) | (Math.abs(green%256)<<8) | Math.abs(blue%256); red += 2; green += 3; blue -= 7; }

- Michael