-
-
Notifications
You must be signed in to change notification settings - Fork 0
Grid
Aravinda VK edited this page Aug 5, 2026
·
3 revisions
// COLS ROWS
grid(3, 2);
(Source)
// COLS ROWS GAP
grid(3, 2, gap: 20);
(Source)
// COLS ROWS GAP
grid(3, 2, gap: 20);
// X Y W H
gridSize(130, 130, 240, 240); // Creates grid within this box
(Source)
// COLS ROWS GAP
grid(3, 2, gap: 20);
fill("gold");
auto box = gridCell(2);
rect(box); // Same as rect(box.x, box.y, box.width, box.height);
(Source)
// COLS ROWS GAP
grid(4, 4, gap: 20);
fill("gold");
auto box = gridArea(7, 12);
rect(box); // Same as rect(box.x, box.y, box.width, box.height);
(Source)
grid(2, 2, gap: 20);
auto box2 = gridCell(2);
grid("sub", 7, 1);
gridSize("sub", box2.x, box2.y, box2.width, box2.height);
auto colors = [
"#9400D3", // Violet
"#4B0082", // Indigo
"#0000FF", // Blue
"#00FF00", // Green
"#FFFF00", // Yellow
"#FF7F00", // Orange
"#FF0000" // Red
];
foreach(i; 0 .. 7)
{
fill(colors[i]);
rect(gridCell("sub", i + 1));
}
(Source)
