OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a list of all colors in a Document CORNMEN CorelDRAW/Corel DESIGNER VBA 5 15-11-2008 05:14
256 colors Nico General 0 26-04-2007 02:10
Minimizing the number of colors used in a document Alex FAQ 1 24-05-2005 10:46
Palette (or Colors array) property in VBA class in CDR12 zlatev CorelDRAW/Corel DESIGNER VBA 7 22-02-2005 11:28
Wish to Convert Named Colors to Shape Color D_Green CorelDRAW/Corel DESIGNER VBA 1 12-09-2004 11:08


All times are GMT -5. The time now is 17:43.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com