added support for auto color with _note and _par

This commit is contained in:
Louis Heredero 2024-10-06 15:12:50 +02:00
parent 3bc103b9d7
commit b66634d44f
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
3 changed files with 11 additions and 1 deletions

View File

@ -25,6 +25,9 @@
panic("Aligned notes can only be over a participant (got side '" + side + "')")
}
}
if color == auto {
color = COL-NOTE
}
return ((
type: "note",
side: side,

View File

@ -13,6 +13,7 @@
"queue",
"custom"
)
#let DEFAULT-COLOR = rgb("#E2E2F0")
#let _par(
name,
@ -20,11 +21,14 @@
from-start: true,
invisible: false,
shape: "participant",
color: rgb("#E2E2F0"),
color: DEFAULT-COLOR,
custom-image: none,
show-bottom: true,
show-top: true,
) = {
if color == auto {
color = DEFAULT-COLOR
}
return ((
type: "par",
name: name,

View File

@ -4,6 +4,9 @@
#import "note.typ"
#let get-arrow-marks(sym, color) = {
if sym == none {
return none
}
if type(sym) == array {
return sym.map(s => get-arrow-marks(s, color))
}