![]() |
#1
|
|||
|
|||
![]()
Hello to everybody from Germany!
I have a custom color palette with a color named "Transparent", see image attached In Corel DRAW 2017 I could get the name of the color with: ActiveShape.Fill.UniformColor.Name In DRAW 2020 this does not work anymore. In 2020 the result of ActiveShape.Fill.UniformColor.Name is "unbenannte farbe" (german for "unnamed color"). i don't know, in wich version this behaviour changed. Does anybody can confirm this bug (or isn't it a bug?) or has an idea, how I can geht the name of the color in DRAW 2020. Thanks in advance Claus |
#2
|
||||
|
||||
![]()
Yep, looks to be a bug. No matter what color I use it always returns "unnamed color". I do not have a work around, if I find one I will let you know.
I will also get this logged. -Shelby |
#3
|
||||
|
||||
![]()
This was asked on the Corel Community Forum so I decided to revisit it and see if I could figure out a work around. If you want to see that entire thread you may see it here:
Color Name not recognised in Color Label Macro in 2021 If you just want the code, then here here an example of a workaround. :-) Code:
Sub LabelSwatches() Dim sr As ShapeRange, sh As Shape, cn As Shape, col As Color, pal As Palette ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected!": Exit Sub ActiveDocument.BeginCommandGroup "ColorsNames" For Each sh In sr Set col = sh.Fill.UniformColor Set pal = col.Palette Set cn = ActiveDocument.ActiveLayer.CreateArtisticText(sh.CenterX, sh.CenterY + (sh.SizeHeight / 2.5), pal.Color(pal.GetIndexOfColor(col)).Name & vbCr & col.Name(True), cdrEnglishUS, , "Arial", sh.SizeWidth / 0.18, , , , cdrCenterAlignment) cn.Fill.ApplyUniformFill CreateCMYKColor(0, 0, 0, 0) Next sh ActiveDocument.EndCommandGroup End Sub -Shelby |
![]() |
Tags |
color name uniformcolor |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Select Same Outline, Fill, Outline & Fill 2018 | dungbtl | CorelDRAW/Corel DESIGNER VBA | 1 | 05-07-2019 07:42 |
Fill Problem | noj | General | 0 | 26-06-2014 00:18 |
Find the layer of the activeshape | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 3 | 22-01-2011 09:17 |
Curious 'With Shape.Fill.UniformColor' Bug | RobC | CorelDRAW/Corel DESIGNER VBA | 2 | 18-11-2008 19:17 |
Fill Combo Box | Shaddy | CorelDRAW/Corel DESIGNER VBA | 1 | 25-07-2006 10:10 |