Change classFontColor dynamically between class boxes

+1 vote
asked Feb 24, 2018 in Bug by fadhelm (120 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

+4 votes
answered Feb 25, 2018 by plantuml (294,960 points)

A possible workaround is to use this http://www.plantuml.com/plantuml/uml/TOz12i8m44NtESLGDte54QaLn4qFCKqcjZHDP6QA5F7kHkD6mTdz_nyFfXP5rdaAHiOXNf5n0XjGv9IY7bD83BT-KFgTpuIEk44xNZZDqHNK8UUCYp5lgA07k1ibqPQqJnbqjDx0vypZ2sq01QgTVScsNSZsVUahM7dl_ukofwReyXzF

However, this is not very handy.

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

@startuml
skinparam classFontColor automatic
skinparam classHeaderBackgroundColor #444

class classA {
testMethodCode()        
}

class classB #fff {
testMethodCode()       
}
@enduml

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 (120 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 (180 points)
"automatic" font pseudo-color would be greatly appreciated across the board.
...