Phases fill foreground method isn't return the correct value

Hello,

I’m trying to get the color value from a phase’s foreground using the getFillForgnd() method.
If I color both phases differently, only the last phase’s color gets imported correctly (inheritFillPhase2). The first one gets imported as the default color (inheritFillPhase1).

Any ideas why this would happen?

Shape phase1 = vsdxDiagram.getPages().get(0).getShapes().get(13);
Shape phase2 = vsdxDiagram.getPages().get(0).getShapes().get(10);

Fill inheritFillPhase1 = phase1.getInheritFill();
String colorFillPhase1 = inheritFillPhase1.getFillForegnd().getValue();

Fill inheritFillPhase2 = phase2.getInheritFill();
String colorFillPhase2 = inheritFillPhase2.getFillForegnd().getValue();

System.out.println(colorFillPhase1);
System.out.println(colorFillPhase2);

OUTPUT:
#4D4D4D
#3F1D05

EXPECTED:
#FFC000
#3F1D05

VisioFile:
Drawing1.zip (38.8 KB)

@aliamirh
A ticket as DIAGRAMJAVA-51057 has been logged in our issue tracking system for the sake of further investigation against your file. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.
Thanks.

1 Like

@aliamirh
Please use the latest version 22.11 and modify the following sample code:
Shape phase1 = page.getShapes().getShapeIncludingChild(15); //get shape id
Shape phase2 = page.getShapes().getShapeIncludingChild(12);
We get the same color as in the source visio file “Drawing1.vsdx”.
Output of the version 22.11
#FFC000
#833C0B

Thanks.

1 Like

Thank you for your reply. Where do the 15 and 12 come from in the getSHapeIncludingChild() method?

@aliamirh
Please open the developer mode of visio and click this shape to check it’s shape id and name.
Phase.PNG (1.4 KB)