How to set different color between header and contents in CARD

0 votes
asked Apr 18, 2023 in Question / help by May-snow
Can I set different color between header and contents in CARD?

The code shown below did not work.

@startuml
card C1 [
    Title #orange
    ---
    content1 #white
    content2 #2
]

@enduml

1 Answer

0 votes
answered Apr 18, 2023 by The-Lu (64,300 points)

Hello M.,

  • What is your goal?
    FontColor or BackgrounColor?

Here is a proposal for Fontcolor, as:

@startuml
card C1 [
    <color:#orange>Title 
    ---
    <color:#white>content1 
    <color:#2>content2
]
@enduml

See also doc. about `creole`, on PlantUML doc. pages.

Regards.

commented Apr 19, 2023 by May-snow
Thank you so much for your response,The-Lu!

I want to set BackgroundColor.
I can set background color by creole,but it only change font background,
I want to set Title area background.
How can I set different background color between header and contents
in card or object?

Regards.
commented Apr 19, 2023 by The-Lu (64,300 points)

Hi M., and all,

1/ For Card:
It is not yet possible.
But it is on the road map... using `style`...
I can open a wanted feature on that...
Awaiting enhancement...

2/ For Object:
It it yet possible, using `style` as :

@startuml
<style>
object {
 BackgroundColor #palegreen
  header {
    BackgroundColor orange
  }
}
</style>

title My title

object "Title" as O1 {
content1
content2
}

object Object2
Object2 : content1

@enduml


Enjoy.
Regards.

commented Apr 20, 2023 by anonymous
Dear The-Lu,

I sincerely thank you to your advice I was able to achieve my goal.
I look forward to be able to <style> for card as well.

Best Regards.
commented Apr 20, 2023 by The-Lu (64,300 points)

Hello M., and all,

Depending of your request...

Why not using also label... and creole table:

label L1 [
    <#orange>|Title|
    <#white>|content1|
    <#2>|<color:#white>content2|
]

card C1 [
    <#orange>| Title 2 |
    <#white>| content1 |
    <#2>|<color:#white> content2 |
]

Enjoy,
Regards,
Th.

...