Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the color of both fork and join states #794

Closed
philippemerle opened this issue Nov 20, 2021 · 4 comments
Closed

Changing the color of both fork and join states #794

philippemerle opened this issue Nov 20, 2021 · 4 comments

Comments

@philippemerle
Copy link

In following example, both a and b states are in blue, but both f and j are still in black:

@startuml
state f <<fork>> #green
state a #blue
state b #blue
state j <<join>> #orange
f --> a
f --> b
a --> j
b --> j
@enduml

Is there a way to change the color of both fork and join states?

@philippemerle
Copy link
Author

I tried:

@startuml
skinparam state {
  BackGroundColor<<MyState>> blue
  BackGroundColor<<fork>> green
  BackGroundColor<<join>> orange
}
state f <<fork>>
state a <<MyState>>
state b <<MyState>>
state j <<join>>
f --> a
f --> b
a --> j
b --> j
@enduml

but f and jare still in black.

Do I make a mistake? or is it a missing feature?

@The-Lum
Copy link
Collaborator

The-Lum commented Nov 21, 2021

Hello @philippemerle,

On state diagram, it is not yet manage...

But a possible workaround is to use ActivityBarColor [sic], and you must to choose between green or orange, because it is managed by the same parameter, as:

@startuml
skinparam state {
  BackGroundColor<<MyState>> blue
}
skinparam ActivityBarColor green

state f <<fork>>
state a <<MyState>>
state b <<MyState>>
state j <<join>>
f --> a
f --> b
a --> j
b --> j
@enduml

@arnaudroques: On the style improvement, could you add fork or join as separate parameters 😉...

If that can help,
Regards.

@philippemerle
Copy link
Author

Thank you very much: this should resolve my need. I tried

@startuml
skinparam state {
  BackGroundColor<<MyState>> blue
}
skinparam ActivityBarColor<<fork>> green
skinparam ActivityBarColor<<join>> orange

state f <<fork>>
state a <<MyState>>
state b <<MyState>>
state j <<join>>
f --> a
f --> b
a --> j
b --> j
@enduml

and now f is in green and j in orange:

@arnaudroques
Copy link
Contributor

@arnaudroques: On the style improvement, could you add fork or join as separate parameters 😉...

With last release, you can have:

@startuml
<style>
state {
  BackGroundColor: blue;
}
activityBar {
  .fork {
    BackGroundColor: green;
  }
  .join {
    BackGroundColor: orange;
  }
}
</style>
state f <<fork>>
state a <<MyState>>
state b <<MyState>>
state j <<join>>
f --> a
f --> b
a --> j
b --> j
@enduml

The syntax (use of activityBar) is a bit weird. We cannot simply use state because the default color of those bars is
black, which is different from regular state background color.
Any suggestion to improve this syntax is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants