Function

@pd

Pick the arguments in a shuffled order, one per cell. Every value is used once before the order repeats, so a set of 4 values covers 4 cells without duplicates.

Syntax

  • @pd(<value>, ...)
  • @pd([<range>])

The shuffle is done once per call site, so a 25-cell grid and @pd with 25 values is a random permutation of them. After a full round the same shuffled order repeats. The shuffle depends on the seed. @pick-d is an older name.

The uppercase @PD reads the enclosing sequence step instead.

Examples

@grid: 5 / 60vmin _1px;
background: @pd(#000, #e6437d, #ebbf4d, #fff);

A random permutation of positions, each used exactly once:

@grid: 5 / 60vmin;
@size: 19%;
@content: @i;
background: #000;
color: #fff;
@place: @pd.m5x5(
  @nx(*20%, -10%) @ny(*20%, -10%)
);

See also