Description
Generate one quarter-turn triangle, diamond or square in every bounded grid cell using reusable random hex palette slots, with explicit polygon vertices and portable SVG; palette slots may repeat and blank triangle/diamond corners stay transparent.
Procedural artwork expresses a visual idea through coordinates, repeated motifs, colors, or explicit placement constraints. A coordinate plan can be checked and reproduced before rendering, while physical material behavior and fabrication require separate information.
Generate one quarter-turn triangle, diamond or square in every bounded grid cell using reusable random hex palette slots, with explicit polygon vertices and portable SVG; palette slots may repeat and blank triangle/diamond corners stay transparent.
When to use this tool
Use this generator to create reproducible geometric color pattern cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply columns, rows, colorCount in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read colors, shapes, svg. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Draw a palette and choose a triangle, diamond, or square for each unit grid cell. Apply a sampled number of quarter turns around the cell center, assign a palette index, and serialize the polygons as SVG.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| columns | Columns | Required. Safe integer; minimum 1; maximum 16. |
| rows | Rows | Required. Safe integer; minimum 1; maximum 16. |
| colorCount | Color Count | Required. Safe integer; minimum 2; maximum 8. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| colors | Colors | Required. Array of Text; minimum UTF-16 length 7; maximum UTF-16 length 7.; minimum items 2; maximum items 8. |
| shapes | Shapes | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 256. |
| shapes[].kind | Kind | Required. Text; one of "triangle", "diamond", "square". |
| shapes[].quarterTurns | Quarter Turns | Required. Safe integer; minimum 0; maximum 3. |
| shapes[].colorIndex | Color Index | Required. Safe integer; minimum 0; maximum 7. |
| shapes[].points | Points | Required. Array of Array of Finite number; minimum 0; maximum 16.; minimum items 2; maximum items 2.; minimum items 3; maximum items 4. |
| svg | Svg | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 65536. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"columns": 2,
"rows": 2,
"colorCount": 3,
"seed": 42
},
"output": {
"colors": [
"#99E1EF",
"#72C32B",
"#DA3B32"
],
"shapes": [
{
"kind": "square",
"quarterTurns": 0,
"colorIndex": 1,
"points": [
[
0,
0
],
[
1,
0
],
[
1,
1
],
[
0,
1
]
]
},
{
"kind": "triangle",
"quarterTurns": 2,
"colorIndex": 2,
"points": [
[
2,
1
],
[
1,
1
],
[
2,
0
]
]
},
{
"kind": "diamond",
"quarterTurns": 0,
"colorIndex": 2,
"points": [
[
0.5,
1
],
[
1,
1.5
],
[
0.5,
2
],
[
0,
1.5
]
]
},
{
"kind": "square",
"quarterTurns": 1,
"colorIndex": 0,
"points": [
[
2,
1
],
[
2,
2
],
[
1,
2
],
[
1,
1
]
]
}
],
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2 2\"><polygon points=\"0,0 1,0 1,1 0,1\" fill=\"#72C32B\"/><polygon points=\"2,1 1,1 2,0\" fill=\"#DA3B32\"/><polygon points=\"0.5,1 1,1.5 0.5,2 0,1.5\" fill=\"#DA3B32\"/><polygon points=\"2,1 2,2 1,2 1,1\" fill=\"#99E1EF\"/></svg>",
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Palette colors can repeat and adjacent cells have no contrast constraint. Coordinates use unit cells rather than physical pixels; SVG is returned artwork, not an executed browser render.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Categorical Color Palette Generator
Assign generated distinct hex colors to distinct supplied category labels under a caller OKLab distance threshold and finite attempt limit; assignments preserve category order and do not imply universal distinguishability.
- Random Color Vision Deficiency Palette Generator
Generate distinct sRGB hex colors separated by a caller threshold in OKLab after each existing full-severity protan/deutan/tritan simulation, with a finite attempt limit and no individual accessibility guarantee.