View Single Post
  #1  
Old 14-12-2007, 13:26
kliv
Guest
 
Posts: n/a
Default Array of colors?

I need to make a calibration bar like this:
So I made a shaperange named bar.
Bar(1) would be a cmyk 100, 0, 0, 0
Bar(2) would be a cmyk 66, 0, 0, 0
Bar(3) would be a cmyk 33, 0, 0, 0
and so on.
The index of bar depends on the lenght of the calibration bar (the height of document). From bar(13) the colors begin again with CMYKAssign 100, 0, 0, 0, CMYKAssign 66, 0, 0, 0 etc.
For the moment I did what I want manually, like this:
Code:
If k + 1 > 1 Then bar(1).Fill.UniformColor.CMYKAssign 100, 0, 0, 0
If k + 1 > 2 Then bar(2).Fill.UniformColor.CMYKAssign 66, 0, 0, 0
If k + 1 > 3 Then bar(3).Fill.UniformColor.CMYKAssign 33, 0, 0, 0
If k + 1 > 4 Then bar(4).Fill.UniformColor.CMYKAssign 0, 100, 0, 0
If k + 1 > 5 Then bar(5).Fill.UniformColor.CMYKAssign 0, 66, 0, 0
If k + 1 > 6 Then bar(6).Fill.UniformColor.CMYKAssign 0, 33, 0, 0
If k + 1 > 7 Then bar(7).Fill.UniformColor.CMYKAssign 0, 0, 100, 0
If k + 1 > 8 Then bar(8).Fill.UniformColor.CMYKAssign 0, 0, 66, 0
If k + 1 > 9 Then bar(9).Fill.UniformColor.CMYKAssign 0, 0, 33, 0
If k + 1 > 10 Then bar(10).Fill.UniformColor.CMYKAssign 0, 0, 0, 100
If k + 1 > 11 Then bar(11).Fill.UniformColor.CMYKAssign 0, 0, 0, 66
If k + 1 > 12 Then bar(12).Fill.UniformColor.CMYKAssign 0, 0, 0, 33
If k + 1 > 13 Then bar(13).Fill.UniformColor.CMYKAssign 100, 0, 0, 0
If k + 1 > 14 Then bar(14).Fill.UniformColor.CMYKAssign 66, 0, 0, 0
If k + 1 > 15 Then bar(15).Fill.UniformColor.CMYKAssign 33, 0, 0, 0
If k + 1 > 16 Then bar(16).Fill.UniformColor.CMYKAssign 0, 100, 0, 0
If k + 1 > 17 Then bar(17).Fill.UniformColor.CMYKAssign 0, 66, 0, 0
If k + 1 > 18 Then bar(18).Fill.UniformColor.CMYKAssign 0, 33, 0, 0
etc
and writing lines like that until I got bored...
I was thinking of an array of colors so my code would look like this
Code:
for i = 1 to k
bar(i).Fill.UniformColor. ??? color(i)
next i
Stuck there...
There must be a simpler way to do this - just can't see it right now...
Reply With Quote