# Geometric Tiles Generator

A standalone package for generating geometric tile patterns in black and white. Similar to Tixy but focused on classic geometric and algorithmic patterns.

## Features

- 20 built-in geometric patterns
- Tile-based rendering system
- Configurable tile size and colors
- Standalone, reusable package

## Patterns

- **Checkerboard**: Classic alternating squares
- **Stripes**: Horizontal and vertical lines
- **Diagonal**: Diagonal line patterns
- **Diamond**: Diamond grid patterns
- **Cross**: Plus/cross intersections
- **Maze**: Maze-like corridors
- **Triangles**: Triangular tessellations
- **Hexagon**: Hexagonal patterns
- **Waves**: Sine wave based patterns
- **Spiral**: Spiral arm patterns
- **Concentric**: Concentric circle rings
- **Bricks**: Brick wall patterns
- **Dots**: Regular dot grids
- **Zigzag**: Zigzag patterns
- **Random**: Pseudo-random noise
- **Voronoi**: Cell-like patterns
- **Fractal**: Sierpinski-like fractals
- **Complex Maze**: Procedural maze generation

## Usage

```typescript
import { GEOMETRIC_PATTERNS, renderTilesToCanvas } from './geometric-tiles'

// Get a pattern
const checkerboard = GEOMETRIC_PATTERNS.checker

// Render to canvas
const result = renderTilesToCanvas(checkerboard, {
  width: 512,
  height: 512,
  tileSize: 8,
  time: 0,
  backgroundColor: '#000000',
  foregroundColor: '#ffffff'
})

// Use the canvas
document.body.appendChild(result.canvas)
```

## API

### TileExpression
- `name`: Human-readable pattern name
- `code`: String representation of the pattern logic
- `compiled`: Function that generates the pattern

### TileRenderOptions
- `width`: Canvas width in pixels
- `height`: Canvas height in pixels
- `tileSize`: Size of each tile in pixels
- `time`: Time parameter (for animated patterns)
- `backgroundColor`: Background color (hex)
- `foregroundColor`: Foreground color (hex)

The tile function receives: `(x, y, i, t, size)` where:
- `x, y`: Tile coordinates
- `i`: Linear tile index
- `t`: Time parameter
- `size`: Grid size (max of width/height in tiles)