how to change the header color of a class diagram

0 votes
asked Aug 29, 2021 in Question / help by martinllanos (120 points)

Given the following puml, how can I alter the artifact color "C", the color of the circle, the background color of the circle, and the font of "C"?

class Server < modules > {

  - __private: {} 

  - self: this

  -- Methods --

  + Server (cb, scope)

  + sandboxApi (call, args, cb)

  + onBind (scope)

  + onBlockchainReady ()

  + cleanup (cb)

  + isLoaded ()

  + areModulesReady ()

}

2 Answers

0 votes
answered Aug 30, 2021 by The-Lu (64,340 points)

Hello M.,

For change color, you can use:

skinparam stereotypeCBackgroundColor palegreen
skinparam stereotypeCBorderColor #black

And observe the result:

See also doc. here:

Regards,
Th.

0 votes
answered Sep 26, 2022 by The-Lu (64,340 points)

Hello M.,

It seems there is a bug with skinparam, but now use style...
Here is now an example by style:

@startuml
<style>
spotClass {
  BackgroundColor palegreen
  LineColor red
  FontName SansSerif
  FontColor blue
}
</style>

class Server < modules > {
  - __private: {} 
  - self: this
  -- Methods --
  + Server (cb, scope)
  + sandboxApi (call, args, cb)
  + onBind (scope)
  + onBlockchainReady ()
  + cleanup (cb)
  + isLoaded ()
  + areModulesReady ()
}
@enduml

Regards,
Th.

...