Change classFontColor dynamically between class boxes

+1 vote
asked Feb 24, 2018 in Bug by fadhelm (200 points)
retagged Feb 25, 2018 by fadhelm

In the following diagram, the classFontColor attribute in the skinparam is set to white.

However if for a specific class I change the background color to a light one, I need to change the classFontColor as well. How do I change the diagram so that classB title font color is displayed in black instead of white?

1 Answer

+3 votes
answered Feb 25, 2018 by plantuml (198,300 points)

A possible workaround is to use this

However, this is not very handy.

In last beta we have added a new color named "automatic" which is white or black, depending of the background. For example, you can have:

skinparam classFontColor automatic
skinparam classHeaderBackgroundColor #444

class classA {

class classB #fff {

This "automatic" color works right now only in limited case. We want to be sure that it's a good idea before going that way.

Any though ?

commented Feb 27, 2018 by fadhelm (200 points)
Ah, the work around is great, thanks! In terms of the "automatic" color, it sounds like a nice "good to have" feature. As long as people can still use the work around if needed for whatever reason, then it sounds like a good idea to me.
commented Mar 28, 2018 by ccharabaruk (250 points)
"automatic" font pseudo-color would be greatly appreciated across the board.