Change classFontColor dynamically between class boxes

0 votes
asked Feb 24 in bug by fadhelm (150 points)
retagged Feb 25 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

+1 vote
answered Feb 25 by plantuml (143,890 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 by fadhelm (150 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.