@up
Read a value one step out: in the @m around the one it is in,
or in the @m around a nested @doodle.
Syntax
- @up(<value>)
- @up.<function>(…), as in @up.n or @up.pn(a, b, c)
Inside two sequences @n is the step of the inner one, and @up.n the step of the outer one:
@m3(@m2(@n@up.n)) gives 11, 21, 12, 22, 13, 23.
@up.up.n goes two steps out.
With no sequence that far out, @n and the other step functions are left as written.
Examples
The inner count is the outer step, so each row holds as many dots as its number,
and every dot reads that number with @up.n for its place and color:
@grid: 1 / 60vmin;
background: @m7(@m(@n,
radial-gradient(5% 5% at
$(50 + (2 * @n - @up.n - 1) * 6)%
$(14 + @up.n * 9)%,
hsl(@up.n(*40) 70% 55%) 90%, #0000)
));
A nested doodle repeated by @m2x2 reads that step with @up,
so each copy draws its own shape in all nine of its cells:
@grid: 1 / 60vmin;
background: @m2x2.doodle(
@grid: 3 / 100% _4px;
background: #000;
@shape: @up.pn(circle, triangle, hexagon, star);
);
background-size: 50% 50%;
background-repeat: no-repeat;
background-position: @m2x2(
@nx(*100%, -100%) @ny(*100%, -100%)
);