OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-11-2008, 14:47
robert
Guest
 
Posts: n/a
Default number spot colors

I want to number the spot colors in a document, so I make a color palette with all the colors in document and another one with the spot colors.

Dim Pals As Palette, PalsP As Palette, c as Color
Set Pals = Palettes.CreateFromDocument("Rob", Application.UserDataPath & "Palettes\Rob.cpl", True)
Set PalsP = Palettes.Create("RobP", Application.UserDataPath & "Palettes\RobP.cpl", True)
For Each c In Pals.Colors
If c.IsTintable Then
PalsP.AddColor c
End If
Next c
msgbox "spot - " & PalsP.ColorCount

Now, if PalsP palette has two colors (100% PANTONE 718 C and
15% PANTONE 718 C), the result will be that I have two spot colors, wich is incorrect, I only have one. How can I resolve this problem when the same color is present in the palette a number of times (with different tints)?
Reply With Quote
  #2  
Old 10-11-2008, 01:08
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default My Guess

I am color stupid, so I am just guessing here. But why don't you copy the color and set the tint to 100% each time? Something like this.
Code:
Sub HowManySpotColors()
    Dim Pals As Palette, PalsP As Palette, c As CorelDRAW.Color, c100Tint As New CorelDRAW.Color
    
    Set Pals = Palettes.CreateFromDocument("Rob", Application.UserDataPath & "Palettes\Rob.cpl", True)
    Set PalsP = Palettes.Create("RobP", Application.UserDataPath & "Palettes\RobP.cpl", True)

    For Each c In Pals.Colors
        If c.IsTintable Then
            c100Tint.CopyAssign c
            c100Tint.Tint = 100
            PalsP.AddColor c100Tint
        End If
    Next c
    
    MsgBox "spot - " & PalsP.ColorCount
End Sub
PANTONE 718 C is created only once in the new palette.

-Shelby
Reply With Quote
  #3  
Old 10-11-2008, 02:05
robert
Guest
 
Posts: n/a
Default

thanks Shelby, you guessed correct!
Reply With Quote
Reply


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
Custom spot colors Alex FAQ 3 10-05-2007 00:41
Install Spot Colors from C++ dynamica CorelDRAW/Corel DESIGNER VBA 1 02-03-2007 09:14
Install Spot Colors form C++ dynamica CorelDRAW CS 0 01-03-2007 03:45
Spot Colors shelbym CorelDRAW/Corel DESIGNER VBA 0 01-10-2005 19:58
Minimizing the number of colors used in a document Alex FAQ 1 24-05-2005 10:46


All times are GMT -5. The time now is 08:30.


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