No random color

 From:  Michael Gibson
4517.6 In reply to 4517.3 
Hi Pilou,

re: pseudo code - that translated to actual code is like this:

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 = ((red%256)<<16) | ((green%256)<<8) | (blue%256); red += 2; green += 3; blue += 7; }

If you run that script it will create 100 styles that are assigned a gradient by the same increments as your pseudo code.

If you want to vary it, change the start values where it says:
var red = 12, green = 15, blue = 20;

or change the increment part at the end where it says:
red += 2; green += 3; blue += 7;

In this one when a value is incremented more than a value of 255 it will "wrap around" back to 0 and continue from there.

Note that this one creates 100 styles as part of the process, don't create 100 blank styles before running it unless you want to have 200 styles total.

- Michael