Don’t know what this means, but I removed some stuff that don’t change the output.
I don’t like that the rainbow isn’t actually what I thought, so I throw in the comparison:
#let opposite-pattern = tiling(size: (30pt, 20pt), polygon(
fill: white,
stroke: 1pt,
// border
(100%, 0%),
(0%, 0%),
(0%, 100%),
(100%, 100%),
// pattern
(0%, 70%),
(0%, 30%),
(100%, 0%),
(100%, 100%),
))
#block(
width: 100%,
height: 20pt,
fill: gradient.linear(..color.map.rainbow),
rect(fill: opposite-pattern, width: 100%, height: 100%, stroke: 1pt),
)
#block(
width: 100%,
height: 20pt,
fill: gradient.linear(red, orange, yellow, green, aqua, blue, purple),
rect(fill: opposite-pattern, width: 100%, height: 100%, stroke: 1pt),
)
#let red = rgb("#f00")
#let orange = rgb("#f70")
#let yellow = rgb("#ff0")
#let green = rgb("#0f0")
#let aqua = rgb("#0ff")
#let blue = rgb("#00f")
#let purple = rgb("#f0f")
#block(
width: 100%,
height: 20pt,
fill: gradient.linear(red, orange, yellow, green, aqua, blue, purple),
rect(fill: opposite-pattern, width: 100%, height: 100%, stroke: 1pt),
)