FontColor for enteties in class diagrams

0 votes
asked Feb 25, 2020 in Question / help by maartensson (140 points)
edited Feb 29, 2020 by maartensson

Hi I am playing around with SkinParam and i cannot find a way to change the colors of the attributes and methods inside the classses. When I use FontColor white, then it only changes the color of the title of the class but the content remains black.

EDIT:
Some more in depth information about my problem:

As you see, none of the things i write in the skinparam affects the color of the attributes and methods in the classes, and they remain black.

UML with colors

    @startuml
        skinparam class{
        BackgroundColor Blue
        FontColor Yellow
        BorderColor Green
        ArrowColor Purple
        ArrowFontColor Orange
    }
    class "ClassTitle1" as C1{
        -atribute1
        +atribute2
        ~atribute3
        -method1()
        +method2()
        ~method3()
    }
    class "ClassTitle2" as C2{
        -atribute1
        +atribute2
        ~atribute3
        -method1()
        +method2()
        ~method3()
    }
    C1 -> C2 : Relation
    @enduml

commented Feb 25, 2020 by albert (3,520 points)
Please show what you got / where your problem lies.

Did you have a look at all the color possibilities as reported by:

java -Djava.awt.headless=true -jar plantuml.jar  -language
commented Feb 29, 2020 by maartensson (140 points)
Thank you very much for your reply! I edited my question and added images for clarity :)
- Martin

1 Answer

0 votes
answered Feb 29, 2020 by albert (3,520 points)

Looks like you don't use the skinparam for the attribute color.

When looking at all the skin parameters defined in plantuml by means of:

java -Djava.awt.headless=true -jar plantuml.jar -language

and only selecting the items with the word class in it we get:

ClassAttributeFontColor
ClassAttributeFontName
ClassAttributeFontSize
ClassAttributeFontStyle
ClassAttributeIconSize
ClassBackgroundColor
ClassBorderColor
ClassBorderThickness
ClassFontColor
ClassFontName
ClassFontSize
ClassFontStyle
ClassHeaderBackgroundColor
ClassStereotypeFontColor
ClassStereotypeFontName
ClassStereotypeFontSize
ClassStereotypeFontStyle
MinClassWidth
SameClassWidth

Here we see the attribute ClassAttributeFontColor and when using AttributeFontColor red in your example we get the image as shown by the plantuml web server:

http://www.plantuml.com/plantuml/png/nO-nJWCn38RtUmgh4mXrIBeneD98C88G2wDfh7AgBwuSHnqGF3kgt5x4m4o6HFh-_DRdTJLKQnCFTJ-M0ofEi6MizNE0yzdWThzJQIKdOL7OSACvV91YZj-8MOvpS6-cutipwZ-KSXygcacTFofHwKLLENhmtFJ0z3lfuvuKoyxJhzFjth18f-TrDAQm0AoGGjzbYMUhCAER2uep-hwWLIzEP1-ImzLrBpgAZhpeQENeBwteMl5_jLA0vHsa2BVmGemsIXdML7AR-0S0

and here we see that the attributes and methods are all red.

I didn't find an item for the methods, might be an enhancement request (@plantuml).

...