New
new() -> function
Create a new palette based on a base style
let p = cetz.palette.new(colors: (red, blue, green))
for i in range(0, p("len")) {
set-style(..p(i))
circle((0,0), radius: .5)
set-origin((1.1, 0))
}
The functions returned by this function have the following named arguments:
If true, the returned fill color is one of the colors from the colors
list, otherwise the base styles fill is used.
If true, the returned stroke color is one of the colors from the colors
list, otherwise the base styles stroke color is used.
You can use a palette for stroking via: red.with(stroke: true)
.
Style dictionary to use as base style for the styles generated per color