Hi all
I'm able to create CMYK colors by the following code
Color colorName = application.CreateCMYKColor(0, 93, 95, 0);
But I need to create a spot color with a specific name to use as an cutline for our cutter. The color is not important, but I need to give it a specific name "cut"I see the application.CreateSpotColor method, but I cant figure out how to use it.
Any suggestions?
Thanks
Never-mind...
I played a little with palettes and I observed that corel exposes only some of them to VGCore. I mean to be created or customized by code: Document Palette, Default Palette and the ones created by user.
I created a pallete (in VBA), added a color, but I couldn't find a way to name that color directly (in VBA code). I used the next code (True to rewrite the existing XML file if this exists):
1 2 3 4 5 6 7
Sub testPalleteCol() Dim colorName As Color, myPall As Palette Set colorName = Application.CreateCMYKColor(0, 93, 95, 0) Set myPall = Application.Palettes.Create("cutsliss", , True) myPall.AddColor colorName Debug.Print myPall.FileName End Sub
To transpose it in VB.NET or C# it is easy... You can see myPall.FileName returns the XML file Path. In my case it is "C:\Users\myUser\Documents\My Palettes\cutsliss.xml". Corel creates a guid for it. I could open it and add a name tag. So now it looks like that (It is easy to do that programmatically):
<?xml version="1.0"?> <palette guid="cd456924-16f6-4e96-8cb5-63e604bc386c" name="cutsliss"> <colors> <page> <color cs="CMYK" name="cut" tints="0,0.93,0.95,0"/> </page> </colors> </palette>
After restarting Corel the color name has been displyed... And it can be used like that:
1 2 3
Dim c As New Color c.CopyAssign Application.Palettes("cutsliss").Colors(1) ActiveShape.Outline.Color = c
Is it what you need? Is it important to be a something from the spot palette? If yes, we can dig deeper and find Corel Palette xml files and add there an element...
Thank you, I'll try this and see.The requirement says that it has to be a spot color, and the RIP will detect the name of the spot color and generate a cutfile for the cutter based on the lines with that specific color.