How can additive blending of overlaying objects be archieved?

I want to overlay colors like so:
Screenshot_20250519_202827

But in typst I can only archieve the following:
Screenshot_20250519_202929

I think, I need additive color blending (lighten blend mode in inkscape).

#set page(fill: black)
#{
  let obj = rect(stroke: none)

  let shift_distance = 4pt

  let shift_colors = (
    rgb("#ff000055"),
    rgb("#00ff0055"),
    rgb("#0000ff55"),
  )
  let shift_vectors = (
    (x: -shift_distance, y: shift_distance),
    (x: 0 * shift_distance, y: 0 * shift_distance),
    (x: shift_distance, y: -shift_distance),
  )

  for i in (0, 1, 2) {
    set rect(fill: shift_colors.at(i))
    place(dx: shift_vectors.at(i).x, dy: shift_vectors.at(i).y, obj)

  }
}
1 Like

Hello. I don’t think there is such a built-in thing.